Skip to content

DO NOT MERGE TO MAIN: temporarily run tasks on 'migration' branch ins… #15

DO NOT MERGE TO MAIN: temporarily run tasks on 'migration' branch ins…

DO NOT MERGE TO MAIN: temporarily run tasks on 'migration' branch ins… #15

Workflow file for this run

name: deploy
on:
push:
branches: ["main", "migration"]
pull_request:
branches: ["main", "migration"]
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
environment: check-${{matrix.environment}}
strategy:
matrix:
environment: ["staging", "firefoxci"]
env:
TASKCLUSTER_ROOT_URL: ${{vars.TASKCLUSTER_ROOT_URL}}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
- name: Install dependencies
run: pip install -r requirements/test.txt
- name: Run checks
run: tc-admin check --environment ${{matrix.environment}}
apply:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: check
environment: apply-${{matrix.environment}}
strategy:
matrix:
environment: ["staging", "firefoxci"]
env:
TASKCLUSTER_ROOT_URL: ${{vars.TASKCLUSTER_ROOT_URL}}
TASKCLUSTER_CLIENT_ID: ${{vars.TASKCLUSTER_CLIENT_ID}}
TASKCLUSTER_ACCESS_TOKEN: ${{secrets.TASKCLUSTER_ACCESS_TOKEN}}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
- name: Install dependencies
run: pip install -r requirements/base.txt
- name: Deploy environment
run: tc-admin apply --environment ${{matrix.environment}}
notify:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: [check, apply]
strategy:
matrix:
environment: ["staging", "firefoxci"]
steps:
- name: Notify Slack
if: always()
run: |

Check failure on line 66 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / deploy

Invalid workflow file

The workflow is not valid. .github/workflows/deploy.yml (Line: 66, Col: 14): Unrecognized named-value: 'JOB_NAME'. Located at position 7 within expression: needs[JOB_NAME].result
WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
SLACK_MESSAGE="*${{ github.workflow }} ${{ github.repository }}* (<${WORKFLOW_URL}|View Workflow>)"
for JOB_NAME in check apply; do
JOB_STATUS="${{ needs[JOB_NAME].result }}"
if [ "${JOB_STATUS}" == "success" ]; then
SLACK_MESSAGE="${SLACK_MESSAGE}\n:white_check_mark: *${JOB_NAME}*
else
SLACK_MESSAGE="${SLACK_MESSAGE}\n:x: *${JOB_NAME}*
fi
done
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"${SLACK_MESSAGE}\"}" ${{ secrets.SLACK_WEBHOOK_URL }}