use arg to pass dynamic version #75
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: OpenTelemetry | |
on: | |
push: | |
branches: | |
- grafana | |
paths-ignore: | |
- '!Dockerfile' | |
- '!.github/workflows' | |
- '!**.yaml' | |
env: | |
AWS_REGION: '${{ secrets.AWS_REGION }}' | |
ENVIRONMENT: STAGE | |
AWS_STAGE: '${{ secrets.AWS_ARN }}' | |
REGISTRY: 'ghcr.io' | |
TAG: 'v2' | |
jobs: | |
push: | |
name: publish image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: checkout the source code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: login to ghcr | |
id: ghcr | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: build / tag / push docker image into ghcr | |
id: build-and-push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.TAG }} |