Deploy to new AR using GA #3
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: Main | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
#paths-ignore: | |
# - '.github/**' | |
pull_request: | |
env: | |
REGISTRY: europe-north1-maven.pkg.dev/artifact-registry-5n/barnevern-maven | |
ARTIFACT_REVISION: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('{0}-SNAPSHOT', github.ref_name) }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- id: "auth" | |
name: Authenticate to Google Cloud | |
uses: "google-github-actions/[email protected]" | |
with: | |
workload_identity_provider: "projects/848539402404/locations/global/workloadIdentityPools/gh-actions/providers/gh-actions" | |
service_account: "gh-actions-barnevern@artifact-registry-5n.iam.gserviceaccount.com" | |
token_format: "access_token" | |
- name: Build with Maven | |
run: mvn -X -P ssb-ga --batch-mode -Drevision=${{ env.ARTIFACT_REVISION }} verify | |
- name: Deploy artifact to Google artifact registry | |
#if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
mvn -DskipTests=true -Dmaven.javadoc.skip=true -U -pl kostra-barnevern -P ssb-ga --batch-mode \ | |
-Djdk.tls.client.protocols="TLSv1.2" -Drevision=${{ env.ARTIFACT_REVISION }} deploy |