Merge pull request #156 from lazybytez/feature/updated-healthchecks #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Continues deployment workflow to automatically | |
# build Docker image on tag | |
name: Deploy Edge | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
edge: | |
runs-on: ubuntu-latest | |
environment: | |
name: Staging | |
env: | |
IS_CI: true | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Docker with buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
buildkitd-flags: --debug | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Login to GitHub packages | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/lazybytez/jojo-discord-bot | |
tags: | | |
type=edge,branch=main | |
- name: Retrieve commit SHA | |
id: commit_sha | |
run: | | |
echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
# Deploy stage image to GHCR | |
- name: Build and publish images | |
uses: docker/build-push-action@v4 | |
id: build_push | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
app_version=edge | |
build_commit_sha=${{ steps.commit_sha.outputs.short }} | |
# Handle stage deployment | |
# Currently disdabled | |
# - name: Mask hidden URLs | |
# run: | | |
# echo "::add-mask::${{ secrets.APP_URL }}" | |
# echo "::add-mask::${{ secrets.SSH_URL }}" | |
# - name: Do deployment | |
# uses: dokku/github-action@master | |
# with: | |
# git_remote_url: ${{ secrets.DEPLOYMENT_HOST }} | |
# ssh_private_key: ${{ secrets.DEPLOYMENT_KEY }} | |
# ssh_host_key: ${{ secrets.DEPLOYMENT_HOST_KEY }} | |
# deploy_docker_image: "ghcr.io/lazybytez/jojo-discord-bot@${{ steps.build_push.outputs.digest }}" |