diff --git a/.github/workflows/build_release.yaml b/.github/workflows/build_release.yaml index 07630d4ba..1b97aa99f 100644 --- a/.github/workflows/build_release.yaml +++ b/.github/workflows/build_release.yaml @@ -4,6 +4,11 @@ on: release: types: [published] workflow_dispatch: + inputs: + tag: + description: 'Tag to build (leave empty for latest)' + required: false + default: '' permissions: packages: write @@ -15,7 +20,10 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'bcgov' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.inputs.tag || github.ref }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -33,10 +41,10 @@ jobs: with: images: ghcr.io/${{ github.repository }}/aries-vcr-agent tags: | + type=raw,value=${{ github.event.inputs.tag }} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - type=ref - type=sha + type=ref,event=tag - name: Build and push image id: builder @@ -53,7 +61,10 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'bcgov' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.inputs.tag || github.ref }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -68,10 +79,10 @@ jobs: with: images: ghcr.io/${{ github.repository }}/aries-vcr-api tags: | + type=raw,value=${{ github.event.inputs.tag }} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - type=ref - type=sha + type=ref,event=tag - name: Setup and build id: build_image @@ -96,7 +107,10 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'bcgov' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.inputs.tag || github.ref }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -111,10 +125,10 @@ jobs: with: images: ghcr.io/${{ github.repository }}/aries-vcr-db tags: | + type=raw,value=${{ github.event.inputs.tag }} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - type=ref - type=sha + type=ref,event=tag - name: Setup and build id: build_image @@ -139,7 +153,10 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'bcgov' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.inputs.tag || github.ref }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -154,10 +171,10 @@ jobs: with: images: ghcr.io/${{ github.repository }}/aries-vcr-solr tags: | + type=raw,value=${{ github.event.inputs.tag }} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - type=ref - type=sha + type=ref,event=tag - name: Setup and build id: build_image