Fleshing out readme slightly #29
Workflow file for this run
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
name: Container Build CICD | |
on: | |
push: | |
tags: ['*.*'] | |
# branches: | |
# - 'main' | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: uvarc/id-generator | |
# IMAGE_TAG: 1.${{ github.run_number }} # GITHUB_RUN_NUMBER }} | |
SVC_NAME: idGenerator | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set ENV | |
run: echo "IMAGE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GHCR_USERNAME }} | |
password: ${{ secrets.GHCR_PAT }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
# Now update another repo so that ArgoCD can deploy the new version. | |
- name: Remote Dispatch | |
run: | | |
curl -X POST https://api.github.com/repos/uvarc/uvarc-services/dispatches \ | |
-H 'Accept: application/vnd.github.everest-preview+json' \ | |
-H "Authorization: token ${{ secrets.GHCR_PAT }}" \ | |
--data '{"event_type": "${{ env.IMAGE_NAME }} update to ${{ env.IMAGE_TAG }}", "client_payload": { "service": "${{ env.SVC_NAME }}", "version": "${{ env.IMAGE_TAG }}" }}' |