change trigger tag #71
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: Build and push container image | |
on: | |
push: | |
tags: | |
#- "[0-9]+.[0-9]+.[0-9]+.?*" | |
- "@orchestrator-ui/orchestrator-ui-components@[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
environment: triggers | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/hanstrompert/test | |
tags: | | |
type=match,pattern=\d+.\d+.\d+.* | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
#- name: Build and push | |
# uses: docker/build-push-action@v5 | |
# with: | |
# context: . | |
# platforms: linux/amd64,linux/arm64 | |
# push: true | |
# tags: ${{ steps.meta.outputs.tags }} | |
# labels: ${{ steps.meta.outputs.labels }} | |
- name: Get latest commit SHA for main of test-client | |
id: sha | |
uses: actions/github-script@v5 | |
with: | |
result-encoding: string | |
script: | | |
const commit = await github.rest.repos.getCommit({ | |
owner: 'hanstrompert', | |
repo: 'test-client', | |
ref: 'heads/main', | |
}) | |
return commit.data.sha | |
- name: Show SHA and REF | |
run: echo "will tag ${{ steps.sha.outputs.result }} with ${{ github.ref_name }}" | |
- name: Tag test-client | |
uses: actions/github-script@v5 | |
env: | |
REF: ${{ format('refs/tags/{0}', github.ref_name) }} | |
SHA: ${{ steps.sha.outputs.result }} | |
with: | |
github-token: ${{ secrets.CREATE_TAG_PAT }} | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: 'test-client', | |
ref: process.env.REF, | |
sha: process.env.SHA, | |
}) |