1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-05 19:05:18 +02:00

update docker image Github Action for full build and push

This commit is contained in:
François Darveau 2021-06-26 18:04:30 -04:00
parent 2593a63e25
commit b64a452411

View file

@ -1,18 +1,48 @@
name: Docker Image CI name: Docker Image CI
on: on:
push: push:
branches: [ master ] branches: [ docker ]
pull_request: pull_request:
branches: [ master ] branches: [ docker ]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - name: Get current date
- name: Build the Docker image id: date
run: docker build . --file Dockerfile --tag flame:$(date +%s) run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Check out the repo
uses: actions/checkout@v2
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=ghcr.io/fdarveau/cors-anywhere
VERSION=latest
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
fi
TAGS="${DOCKER_IMAGE}:latest,${DOCKER_IMAGE}:${{ steps.date.outputs.date }}"
echo ::set-output name=tags::${TAGS}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }}
- name: Push to GitHub Packages
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.prep.outputs.tags }}