DO NOT MERGE TO MAIN: temporarily run tasks on 'migration' branch ins… #12
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: 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 GitHub Actions / deployInvalid workflow file
|
||
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 ${!needs.*.result}; 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 }} |