Skip to content

Deploy

Deploy #31

Workflow file for this run

name: Deploy
on:
workflow_run:
workflows: ["Checks"]
types: [completed]
branches:
- "main"
workflow_dispatch:
inputs:
deploySkip:
required: false
description: "Skip (web|service|front)"
default: ""
deployOnly:
required: false
description: "Only (web|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'