-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.19 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Deploy
on:
workflow_dispatch:
inputs:
skip_check:
type: boolean
default: false
description: 'Skip the check step'
required: false
jobs:
build-and-deploy:
if: github.repository == 'igncp/writing-trainer' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Check 🔧
run: |
touch ./is-ci
cp .env.example .env
nix develop path:$(pwd) -c bash scripts/check.sh
env:
SKIP_CHECK: ${{ github.event.inputs.skip_check }}
- name: Build and publish docker image
run: |
nix develop path:$(pwd) -c bash -c scripts/ci/build_docker.sh
env:
DEPLOYMENT_LOCATION: ${{ secrets.DEPLOYMENT_LOCATION }}
DEPLOYMENT_TOKEN: ${{ secrets.DEPLOYMENT_TOKEN }}