Skip to content

fix(ci): set environment at top level (#1482) #494

fix(ci): set environment at top level (#1482)

fix(ci): set environment at top level (#1482) #494

Workflow file for this run

name: Merge
on:
push:
branches: [main]
paths-ignore:
- '*.md'
- '.github/**'
- '.github/graphics/**'
- '!.github/workflows/**'
concurrency:
# Do not interrupt previous workflows
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
init:
name: Initialize
outputs:
pr: ${{ steps.pr.outputs.pr }}
runs-on: ubuntu-latest
steps:
# Get PR number for squash merges to main
- name: PR Number
id: pr
uses: bcgov-nr/[email protected]
deploys:
name: TEST
needs: [init]
secrets: inherit
uses: ./.github/workflows/.deploy.yml

Check failure on line 33 in .github/workflows/merge.yml

View workflow run for this annotation

GitHub Actions / Merge

Invalid workflow file

The workflow is not valid. In .github/workflows/merge.yml (Line: 33, Col: 11): Error from called workflow bcgov/nr-spar/.github/workflows/.deploy.yml@6743925cb8e3f7f1d13bc3a7653607fefec9c8d7 (Line: 32, Col: 1): Unexpected value 'environment'
with:
environment: test
tag: ${{ needs.init.outputs.pr }}
target: test
promote:
name: Promote Images
env:
target: ${{ needs.init.outputs.pr }}
tag: prod
needs: [init, deploys]
runs-on: ubuntu-latest
strategy:
matrix:
package: [backend, common, database, frontend, oracle-api, sync]
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ env.target }}
tags: ${{ env.tag }}
- run: |
# Verify tagging
INSPECT="docker manifest inspect ghcr.io/${{ github.repository }}/${{ matrix.package }}"
TARGET=$(${INSPECT}:${{ env.target }} | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest')
TAG=$(${INSPECT}:${{ env.tag }} | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest')
echo "TARGET: ${TARGET}"
echo "TAG: ${TAG}"
if [ "${TARGET}" != "${TAG}" ]; then
echo "ERROR: Tagging failed!"
echo "RETRY=true" >> $GITHUB_ENV
else
echo "ERROR: Tagging success!"
echo "RETRY=false" >> $GITHUB_ENV
fi