Merge pull request #13 from manics/release-2.0.0-beta.1 #47
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: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
validate: | |
name: terraform lint and validate | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 4 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check tag updated if this is a tag | |
run: | | |
./ci/check_tag.sh | |
- name: Install terraform | |
uses: hashicorp/setup-terraform@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Validate | |
run: | | |
cd ecs-cluster | |
terraform init -backend=false | |
terraform validate | |
- name: pre-commit | |
uses: pre-commit/[email protected] | |
container-build: | |
runs-on: ubuntu-22.04 | |
needs: | |
- validate | |
permissions: | |
contents: read | |
packages: write | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
# Set this to `main` to rebuild container on every push to main | |
# instead of just tags | |
PUBLISH_BRANCH: "" | |
PLATFORMS: linux/amd64,linux/arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
if: > | |
github.event_name == 'push' && | |
(github.ref == format('refs/heads/{0}', env.PUBLISH_BRANCH) || | |
startsWith(github.ref, 'refs/tags/')) | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# https://github.com/docker/metadata-action | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# https://github.com/docker/build-push-action | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./container | |
platforms: ${{ env.PLATFORMS }} | |
push: > | |
${{ github.ref == format('refs/heads/{0}', env.PUBLISH_BRANCH) || | |
startsWith(github.ref, 'refs/tags/') }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |