Build and push image to Verji Azure Image Registry #134
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: Build and push image to Verji Azure Image Registry | |
on: | |
workflow_dispatch: {} | |
# push: | |
# tags: [v*] | |
# schedule: | |
# # This job can take a while, and we have usage limits, so just publish develop only twice a day | |
# - cron: "0 7/12 * * *" | |
concurrency: ${{ github.workflow }}-${{ github.ref_name }} | |
jobs: | |
buildx: | |
name: Docker Buildx | |
runs-on: ubuntu-latest | |
environment: dockerhub | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- variant: vanilla | |
# Variant we ship to aid ESS in providing a build on the OpenCoDE platform including specific modules | |
# - variant: opendesk | |
# flavor: suffix=-opendesk,onlatest=true | |
# prepare: mv variants/openDesk/* . | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # needed for docker-package to be able to calculate the version | |
- name: Generate build number | |
id: buildnumber | |
uses: onyxmueller/build-tag-number@v1 | |
with: | |
token: ${{ secrets.github_token }} | |
# - run: | | |
# write-output $env:build_number | |
# env: | |
# build_number: ${{ steps.buildnumber.outputs.build_number }} | |
# shell: pwsh | |
- name: Prepare | |
if: matrix.prepare | |
run: ${{ matrix.prepare }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3 | |
with: | |
install: true | |
- name: Login to Azure ACR | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 | |
with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
registry: acrverjing.azurecr.io | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c # v5 | |
with: | |
images: | | |
acrverjing.azurecr.io/verji-element-app-image | |
tags: | | |
type=ref,event=branch | |
type=ref,event=tag | |
type=raw,value=${{ env.RELEASE_VERSION }} | |
flavor: | | |
latest=${{ contains(github.ref_name, '-rc.') && 'false' || 'auto' }} | |
${{ matrix.flavor }} | |
- name: Build and push | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5 | |
with: | |
context: . | |
file: Dockerfile.Verji | |
push: true | |
build-args: | | |
USE_CUSTOM_SDKS=true | |
REACT_SDK_REPO=${{ secrets.REACT_SDK_WITH_TOKEN }} | |
JS_SDK_REPO=${{secrets.JS_SDK_WITH_TOKEN}} | |
MODULE_API_REPO=${{secrets.MODULE_API_WITH_TOKEN}} | |
BUILD_ID=${{ steps.buildnumber.outputs.build_number }} | |
GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}} | |
platforms: linux/amd64,linux/arm64 | |
#tags: acrverjing.azurecr.io/verji-element-app-image:${{ env.RELEASE_VERSION }} | |
tags: ${{ steps.meta.outputs.tags }}-${{steps.buildnumber.outputs.build_number}} | |
labels: ${{ steps.meta.outputs.labels }} | |
# - name: Update repo description | |
# if: matrix.variant == 'vanilla' | |
# uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae # v4 | |
# continue-on-error: true | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# repository: vectorim/element-web |