-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (48 loc) · 1.52 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
43
44
45
46
47
48
49
50
name: Deploy
on:
workflow_run:
workflows: ["Checks"]
types: [completed]
branches:
- "main"
workflow_dispatch:
inputs:
deploySkip:
required: false
description: "Skip (service|front)"
default: ""
deployOnly:
required: false
description: "Only (service|front)"
default: ""
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build script
run: |
touch ./scripts/nix/is-docker-ci
nix develop path:$(pwd) -c rustup install stable
- name: Build docker image
env:
DEPLOY_ONLY: ${{ github.event.inputs.deployOnly }}
DEPLOY_SKIP: ${{ github.event.inputs.deploySkip }}
NEXT_PUBLIC_GITHUB_CLIENT_ID: 5b79179dd44f90e1a63a
NEXT_PUBLIC_SERVICE_URL: https://mahjong-rust.com/api
run: |
nix develop path:$(pwd) -c bash -c 'cd scripts && bash src/main.sh docker'