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: Build and push docker images | ||
on: | ||
push: | ||
# branches: | ||
# - main | ||
workflow_dispatch: | ||
jobs: | ||
backend: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
application: | ||
- api | ||
- bots | ||
- eval | ||
- eventsub | ||
- integrations | ||
- parser | ||
- scheduler | ||
- timers | ||
- watched | ||
- websockets | ||
- tokens | ||
- emotes-cacher | ||
- events | ||
- ytsr | ||
- migrations | ||
platform: | ||
- linux/arm64 | ||
- linux/amd64 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
Check failure on line 38 in .github/workflows/docker.yml GitHub Actions / Build and push docker imagesInvalid workflow file
|
||
TAG=$(echo $GITHUB_SHA | head -c7) | ||
IMAGE=${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}-${{ matrix.platform }} | ||
echo ::set-output name=tagged_image::${IMAGE}:${TAG} | ||
echo ::set-output name=tag::${TAG} | ||
platform_part="${{ matrix.platform#*\/ }}" | ||
echo "PLATFORM_PAIR=$platform_part" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@master | ||
with: | ||
install: true | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-single-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-single-buildx | ||
- name: Login to Container Registry | ||
uses: docker/login-action@v1.14.1 | ||
with: | ||
registry: ${{ secrets.DOCKER_REGISTRY }} | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build ${{ matrix.application }}-${{ env.PLATFORM_PAIR }} | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
platforms: ${{ matrix.platform }} | ||
context: . | ||
push: true | ||
file: ./Dockerfile | ||
target: ${{ matrix.application }} | ||
tags: | | ||
${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest-${{ env.PLATFORM_PAIR }} | ||
create-manifests: | ||
runs-on: ubuntu-latest | ||
needs: [ backend ] | ||
strategy: | ||
matrix: | ||
application: | ||
- api | ||
- bots | ||
- eval | ||
- eventsub | ||
- integrations | ||
- parser | ||
- scheduler | ||
- timers | ||
- watched | ||
- websockets | ||
- tokens | ||
- emotes-cacher | ||
- events | ||
- ytsr | ||
- migrations | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Login to Container Registry | ||
uses: docker/login-action@v1.14.1 | ||
with: | ||
registry: ${{ secrets.DOCKER_REGISTRY }} | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Create latest manifest for ${{ matrix.application }} | ||
run: | | ||
docker manifest create \ | ||
${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest \ | ||
--amend ${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest-amd64 \ | ||
--amend ${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest-arm64 | ||
docker manifest push ${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest | ||
frontend: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
application: | ||
[ | ||
dashboard, | ||
landing, | ||
overlays, | ||
public, | ||
] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
TAG=$(echo $GITHUB_SHA | head -c7) | ||
IMAGE=${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }} | ||
echo ::set-output name=tagged_image::${IMAGE}:${TAG} | ||
echo ::set-output name=tag::${TAG} | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@master | ||
with: | ||
install: true | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-single-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-single-buildx | ||
- name: Login to Container Registry | ||
uses: docker/login-action@v1.14.1 | ||
with: | ||
registry: ${{ secrets.DOCKER_REGISTRY }} | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build ${{ matrix.application }} | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
context: . | ||
push: true | ||
file: ./Dockerfile | ||
target: ${{ matrix.application }} | ||
tags: | | ||
${{ secrets.DOCKER_REGISTRY }}/twir/${{ matrix.application }}:latest | ||
postgres-backup: | ||
name: Build postgres-backup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
TAG=$(echo $GITHUB_SHA | head -c7) | ||
IMAGE=${{ secrets.DOCKER_REGISTRY }}/twir/postgres-backup | ||
echo ::set-output name=tagged_image::${IMAGE}:${TAG} | ||
echo ::set-output name=tag::${TAG} | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@master | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-single-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-single-buildx | ||
- name: Login to Container Registry | ||
uses: docker/login-action@v1.14.1 | ||
with: | ||
registry: ${{ secrets.DOCKER_REGISTRY }} | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build postgres-backup docker | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
context: . | ||
push: true | ||
file: ./tools/pg-backup/Dockerfile | ||
tags: | | ||
${{ secrets.DOCKER_REGISTRY }}/twir/postgres-backup:latest |