Skip to content

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

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

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

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}}
- name: Notify Slack
if: always()
run: |
SLACK_MESSAGE="*${{ github.workflow }} ${{ github.repository }} - ${{ job.name }}"
if [ "${{ job.status }}" == "success" ]; then
SLACK_MESSAGE=":white_check_mark ${SLACK_MESSAGE} *success*"
else
SLACK_MESSAGE=":x: ${SLACK_MESSAGE} *failed*"
fi
WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
SLACK_MESSAGE="${SLACK_MESSAGE}\n<${WORKFLOW_URL}|View Workflow Run>"
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"${SLACK_MESSAGE}\"}" ${{ secrets.SLACK_WEBHOOK_URL }}