-
Notifications
You must be signed in to change notification settings - Fork 14
59 lines (46 loc) · 1.8 KB
/
scheduled-deployment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Scheduled deployment
on:
schedule:
- cron: '38 7,11 * * 1-5' # 9:38 AM and 1:38 PM UTC time, Monday to Friday
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
permissions: write-all
name: Deploy last release
steps:
- uses: actions/checkout@v4
- name: Fetch all tags
run: git fetch --tags
- name: Set an output variable with the latest tag
id: latest_tag
shell: bash
run: echo "latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT
- name: Checkout latest tag
run: git checkout ${{ steps.latest_tag.outputs.latest_tag }}
- name: Install dependencies
uses: ./.github/workflows/yarn
- name: Build
uses: ./.github/workflows/build
with:
secrets: ${{ toJSON(secrets) }}
is-production: ${{ true }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
# Script to upload release files
- name: 'Upload release build files for production'
env:
BUCKET: s3://${{ secrets.AWS_STAGING_BUCKET_NAME }}/releases/${{ steps.latest_tag.outputs.latest_tag }}
run: bash ./scripts/github/s3_upload.sh
# Script to prepare production deployments
- name: 'Prepare production deployment'
run: bash ./scripts/github/prepare_production_deployment.sh
env:
PROD_DEPLOYMENT_HOOK_TOKEN: ${{ secrets.PROD_DEPLOYMENT_HOOK_TOKEN }}
PROD_DEPLOYMENT_HOOK_URL: ${{ secrets.PROD_DEPLOYMENT_HOOK_URL }}
VERSION_TAG: ${{ steps.latest_tag.outputs.latest_tag }}