Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Scheduled deployment CI job #364

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/scheduled-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Scheduled deployment

on:
schedule:
- cron: '38 9,13,15 * * *' # Every day at 9:38, 13:38, 15:38 UTC

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
Loading