mirror of
https://github.com/pacnpal/markov-discord.git
synced 2025-12-20 03:01:04 -05:00
Update Docker config build
This commit is contained in:
41
.github/workflows/build-and-push-image.yml
vendored
41
.github/workflows/build-and-push-image.yml
vendored
@@ -1,26 +1,32 @@
|
||||
name: Build and push image
|
||||
name: MultiArchDockerBuild
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
build_and_push_image:
|
||||
name: Build Docker image and push to registries
|
||||
build_multi_arch_image:
|
||||
name: Build multi-arch Docker image.
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
install: true
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: charlocharlie
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
@@ -30,15 +36,32 @@ jobs:
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build_push
|
||||
- name: Build and push master
|
||||
if: ${{ github.ref == 'refs/heads/master' }}
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
target: deploy
|
||||
push: true
|
||||
tags: |
|
||||
charlocharlie/markov-discord:latest
|
||||
ghcr.io/${{ github.repository }}:latest
|
||||
ghcr.io/${{ github.repository }}:${{ github.sha }}
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
||||
build-args: |
|
||||
COMMIT_SHA=${{ github.sha }}
|
||||
cache-from: type=gha,scope=${{ github.workflow }}
|
||||
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build_push.outputs.digest }}
|
||||
- name: Build and push dev
|
||||
if: ${{ github.ref == 'refs/heads/develop' }}
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
target: deploy
|
||||
push: true
|
||||
tags: |
|
||||
charlocharlie/epicgames-freegames:dev
|
||||
ghcr.io/claabs/epicgames-freegames-node:dev
|
||||
platforms: linux/amd64
|
||||
build-args: |
|
||||
COMMIT_SHA=${{ github.sha }}
|
||||
cache-from: type=gha,scope=${{ github.workflow }}
|
||||
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
|
||||
|
||||
Reference in New Issue
Block a user