Docker PR CI #349
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: Docker PR CI | |
on: | |
pull_request: | |
merge_group: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: https://ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64, linux/arm64, linux/riscv64, linux/arm/v7, linux/arm/v6, aarch64 | |
push: true | |
tags: | | |
ghcr.io/techlauncherfireapp/backend:pr-${{ github.event.pull_request.number }} | |
smoke: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Download docker compose config | |
run: wget https://raw.githubusercontent.com/TechlauncherFireApp/docker/main/docker-compose.frontend.yml | |
- name: Find and Replace | |
uses: jacobtomlinson/gha-find-replace@v3 | |
with: | |
find: "ghcr.io/techlauncherfireapp/backend:latest" | |
replace: "ghcr.io/techlauncherfireapp/backend:pr-${{ github.event.pull_request.number }}" | |
regex: false | |
- name: Docker Compose version | |
run: docker compose version | |
- name: Start containers | |
run: docker compose -f "docker-compose.frontend.yml" up -d --wait | |
- name: Test container | |
run: docker run --network container:backend-fireapp-1 appropriate/curl -s --retry 10 --retry-connrefused http://localhost:5000/ |