3.0.10 #9
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: Release docker image | |
on: | |
release: | |
types: [ published ] | |
env: | |
REGISTRY: europe-north1-docker.pkg.dev/artifact-registry-5n/dapla-pseudo-docker/ssb/dapla | |
IMAGE: dapla-dlp-pseudo-service | |
jobs: | |
release-docker: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Authenticate to Google Cloud | |
id: auth | |
uses: google-github-actions/[email protected] | |
with: | |
workload_identity_provider: "projects/848539402404/locations/global/workloadIdentityPools/gh-actions/providers/gh-actions" | |
service_account: "gh-actions-dapla-pseudo@artifact-registry-5n.iam.gserviceaccount.com" | |
token_format: access_token | |
- name: Login to Artifact Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: "oauth2accesstoken" | |
password: "${{ steps.auth.outputs.access_token }}" | |
- name: Docker meta | |
id: metadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE }} | |
# Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr,suffix=-${{ github.event.pull_request.head.sha }} | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=raw,value={{branch}}-{{sha}},enable={{is_default_branch}} | |
type=semver,pattern=v{{version}} | |
type=semver,pattern=v{{major}}.{{minor}} | |
type=semver,pattern=v{{major}} | |
- name: Download Java asset | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
mkdir -p target | |
# Download just the jar file (no javadoc or sources) | |
gh release download -p "*${{ github.event.release.tag_name }}.jar" -D target | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
file: Dockerfile | |
push: true | |
context: . | |
tags: | | |
${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |