only build tft on pr merge/push #6
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 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set date | |
id: date | |
run: echo "::set-output name=date::$(date +'%m-%d-%Y')" | |
- name: Authenticate | |
uses: docker/login-action@v1 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Build and Push TFT-x86 image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./images/ | |
file: Containerfile | |
push: true | |
tags: | | |
quay.io/wizhao/tft-tools:${{ steps.date.outputs.date }}-x86_64 | |
- name: Build and Push TFT-ARM64 image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./images/ | |
file: Containerfile | |
push: true | |
platforms: linux/arm64 | |
tags: | | |
quay.io/wizhao/tft-tools:${{ steps.date.outputs.date }}-aarch64 | |
- name: Create and Push Multi-Architecture Manifest | |
run: | | |
sudo podman manifest create tft-tools-${{ steps.date.outputs.date }}-list | |
sudo podman manifest add tft-tools-${{ steps.date.outputs.date }}-list quay.io/wizhao/tft-tools:${{ steps.date.outputs.date }}-x86_64 | |
sudo podman manifest add tft-tools-${{ steps.date.outputs.date }}-list quay.io/wizhao/tft-tools:${{ steps.date.outputs.date }}-aarch64 | |
sudo podman manifest push tft-tools-${{ steps.date.outputs.date }}-list quay.io/wizhao/tft-tools:${{ steps.date.outputs.date }} | |
sudo podman manifest push tft-tools-${{ steps.date.outputs.date }}-list quay.io/wizhao/tft-tools:latest |