fix: Serve RFC URLs without leading 0s + enable serving RFC > 9999 (#… #302
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: main | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: us-east-1 | |
EKS_CLUSTER_NAME: bibxml-test-cluster | |
KUBECONFIG: /home/runner/.kube/config | |
steps: | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
with: | |
ref: main | |
- name: Build images | |
run: | | |
docker build --no-cache --build-arg SNAPSHOT="${GITHUB_REF#refs/*/}" --platform=linux/amd64 -t bibxml . | |
docker tag bibxml:latest 916411375649.dkr.ecr.us-east-1.amazonaws.com/bibxml:latest | |
docker push 916411375649.dkr.ecr.us-east-1.amazonaws.com/bibxml:latest | |
- name: Trigger db migration | |
env: | |
GH_USERNAME: ${{ secrets.GH_USERNAME }} | |
GH_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
curl -X POST \ | |
https://api.github.com/repos/ietf-ribose/bibxml-infrastructure/actions/workflows/db-migration.yml/dispatches \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-u ${GH_USERNAME}:${GH_PAT} \ | |
--data '{ | |
"ref": "main" | |
}' | |
- name: Setup kubeconfig | |
run: | | |
aws eks --region $AWS_REGION update-kubeconfig --name $EKS_CLUSTER_NAME | |
- name: Install kubectl | |
run: | | |
curl -o kubectl https://s3.us-west-2.amazonaws.com/amazon-eks/1.22.6/2022-03-09/bin/linux/amd64/kubectl | |
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl | |
kubectl version --client | |
- name: Wait for db migration job to complete or timeout after 300s | |
run: | | |
kubectl wait --for=condition=complete --timeout=300s job/db-migration | |
- name: Rollout updates | |
if: always() | |
run: | | |
kubectl rollout restart deployment web | |
kubectl rollout restart deployment celery | |
kubectl rollout restart deployment flower | |
- name: Check rollout statuses | |
run: | | |
kubectl rollout status deployment web | |
kubectl rollout status deployment celery | |
kubectl rollout status deployment flower | |
kubectl get po -o wide |