Skip to content

Merge pull request #156 from lazybytez/feature/updated-healthchecks #22

Merge pull request #156 from lazybytez/feature/updated-healthchecks

Merge pull request #156 from lazybytez/feature/updated-healthchecks #22

Workflow file for this run

# Continues deployment workflow to automatically
# build Docker image on tag
name: Deploy Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
release:
runs-on: ubuntu-latest
environment:
name: Production
env:
IS_CI: true
steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Retrieve commit SHA
id: commit_sha
run: echo "::set-output name=short::$(git rev-parse --short HEAD)"
- name: Build and publish public image
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=${{ github.ref_name }}
build_commit_sha=${{ steps.commit_sha.outputs.short }}
# Handle prod deployment
# Currently disdabled
# - name: Mask hidden URLs
# run: |
# 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 }}"