Skip to content

Bump golang.org/x/crypto from 0.27.0 to 0.31.0 #47

Bump golang.org/x/crypto from 0.27.0 to 0.31.0

Bump golang.org/x/crypto from 0.27.0 to 0.31.0 #47

name: Test, Deploy, Publish
on:
push:
branches: [ '**' ]
tags: [ 'v*' ]
paths-ignore:
- 'terraform/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
env:
AWS_REGION: ${{ vars.AWS_REGION }}
STG_AWS_ACCESS_KEY_ID: ${{ vars.STG_AWS_ACCESS_KEY_ID }}
STG_AWS_SECRET_ACCESS_KEY: ${{ secrets.STG_AWS_SECRET_ACCESS_KEY }}
PRD_AWS_ACCESS_KEY_ID: ${{ vars.PRD_AWS_ACCESS_KEY_ID }}
PRD_AWS_SECRET_ACCESS_KEY: ${{ secrets.PRD_AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Test
run: docker compose -f actions-services.yml run --rm test ./scripts/test.sh
lint:
name: Lint and Vulnerability Scan
runs-on: ubuntu-latest
timeout-minutes: ${{ fromJSON(vars.DEFAULT_JOB_TIMEOUT_MINUTES) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
deploy:
name: Deploy to AWS Lambda
needs: [ 'tests', 'lint' ]
if: github.ref_name == 'main' || github.ref_name == 'develop'
runs-on: ubuntu-latest
concurrency:
group: deploy-${{ github.ref }}-${{ matrix.region }}
cancel-in-progress: false
strategy:
matrix:
region: [ us-east-1, us-west-2 ]
env:
AWS_REGION: ${{ vars.AWS_REGION }}
STG_AWS_ACCESS_KEY_ID: ${{ vars.STG_AWS_ACCESS_KEY_ID }}
STG_AWS_SECRET_ACCESS_KEY: ${{ secrets.STG_AWS_SECRET_ACCESS_KEY }}
STG_LAMBDA_ROLE: ${{ vars.STG_LAMBDA_ROLE }}
STG_API_KEY_TABLE: ${{ vars.STG_API_KEY_TABLE }}
STG_WEBAUTHN_TABLE: ${{ vars.STG_WEBAUTHN_TABLE }}
PRD_AWS_ACCESS_KEY_ID: ${{ vars.PRD_AWS_ACCESS_KEY_ID }}
PRD_AWS_SECRET_ACCESS_KEY: ${{ secrets.PRD_AWS_SECRET_ACCESS_KEY }}
PRD_LAMBDA_ROLE: ${{ vars.PRD_LAMBDA_ROLE }}
PRD_API_KEY_TABLE: ${{ vars.PRD_API_KEY_TABLE }}
PRD_WEBAUTHN_TABLE: ${{ vars.PRD_WEBAUTHN_TABLE }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy
run: docker compose -f actions-services.yml run --rm app ./scripts/deploy.sh ${{ matrix.region }}
build-and-publish:
name: Build and Publish
needs: [ 'tests', 'lint' ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor}}
password: ${{ secrets.GITHUB_TOKEN}}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ vars.IMAGE_NAME }}
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major.minor}}
type=semver,pattern={{major}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}