Skip to content

πŸš€ Release

πŸš€ Release #1

Workflow file for this run

name: πŸš€ Release
on:
workflow_dispatch:
jobs:
check-branches:
name: Check branches
runs-on: self-hosted
steps:
- name: Check branch
run: |
if [[ "${{ github.ref_name }}" != "${{ github.event.repository.default_branch }}" ]]; then
echo "This action can only be run on the ${{ github.event.repository.default_branch }} branch"
exit 1
fi
ci:
needs: check-branches
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml
permissions:
contents: read
id-token: write
issues: read
packages: write
pull-requests: read
update_release_draft:
name: Draft a new release
# we want to publish a new tag only if ci succeeds
needs: ci
permissions:
contents: write
pull-requests: write
runs-on: self-hosted
steps:
- id: update_release_draft
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
publish: true
disable-autolabeler: true
- uses: docker/login-action@v3
with:
registry: "ghcr.io"
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v3
with:
registry: "docker.io"
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Push built images to Docker.io
run: |
APP_IMAGE="${{ fromJson(needs.ci.outputs.built-images).app.images[0] }}"
docker pull "$APP_IMAGE"
APP_TAG="${{ steps.update_release_draft.outputs.tag_name }}"
APP_REGISTRY_PATH="docker.io/webofmars"
APP_DOCKERIO_IMAGE="${APP_REGISTRY_PATH}/http-header-authenticator:$APP_TAG"
docker tag "$APP_IMAGE" "$APP_DOCKERIO_IMAGE"
docker push "$APP_DOCKERIO_IMAGE"