Skip to content

ct-app v3.9.1

ct-app v3.9.1 #76

name: GCP Artifact Tagging
on:
release:
types:
- published
jobs:
tag-artifact:
name: Tag GCP artifact
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Google Cloud Credentials
id: auth
uses: google-github-actions/auth@v2
with:
token_format: "access_token"
credentials_json: ${{ secrets.GOOGLE_HOPRASSOCIATION_CREDENTIALS_REGISTRY }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: hoprassociation
install_components: beta
- name: Login Google Container Registry
uses: docker/login-action@v3
with:
registry: europe-west3-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Apply tag to GCP artifact
run: |
docker_registry=europe-west3-docker.pkg.dev
image=hoprassociation/docker-images/cover-traffic
commit_tag=$(git rev-parse --short "$GITHUB_SHA")
tag=${{ github.ref_name }}
echo "Tag from release: ${tag}"
echo "Short sha: ${commit_tag}"
gcloud artifacts docker tags add ${docker_registry}/${image}:${commit_tag} ${docker_registry}/${image}:${tag}