Skip to content

Commit

Permalink
ci: Refactor Minimap API build and push workflows
Browse files Browse the repository at this point in the history
- Removed unnecessary path restriction in the build workflow
- Updated DockerHub login action to v2
- Added setup for QEMU and Docker Buildx in the build workflow
- Replaced GHCR login action with DockerHub login action in the push workflow
- Modified push step to use docker/build-push-action@v4 for building and pushing images with updated tags
  • Loading branch information
SakuraIsayeki committed Jul 20, 2023
1 parent a2f1df6 commit e941f25
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/minimap-api-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Build Minimap API Docker Image

on:
push:
paths:
- 'wowskarma_api_minimap/**'
workflow_dispatch:


Expand All @@ -15,4 +13,4 @@ jobs:
- uses: actions/checkout@v2

- name: Build Docker Image
run: docker build -f wowskarma_api_minimap/Dockerfile.dev -t wowskarma_api_minimap:tag .
run: docker build -f wowskarma_api_minimap/Dockerfile.dev -t wowskarma_api_minimap:tag wowkarma_api_minimap
47 changes: 26 additions & 21 deletions .github/workflows/minimap-api-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,34 @@ on:
branches: [ main ]

jobs:
release_dockerhub:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dockerhub: [
# { registry: "docker.io", username: "${{ secrets.DOCKERHUB_USERNAME }}", password: "${{ secrets.DOCKERHUB_TOKEN }}" },
{ registry: "ghcr.io", username: "${{ github.actor }}", password: "${{ github.token }}" }
]

steps:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: actions/checkout@v2

- name: Push to DockerHub
run: docker push wowskarma_api_minimap:tag
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

release_ghcr:
runs-on: ubuntu-latest
steps:
- name: Login to GHCR
uses: docker/login-action@v1
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push to GHCR
run: |
docker tag wowskarma_api_minimap:tag ghcr.io/${{ github.repository }}/wowskarma_api_minimap:tag
docker push ghcr.io/${{ github.repository }}/wowskarma_api_minimap:tag
registry: ${{ matrix.dockerhub.registry }}
username: ${{ matrix.dockerhub.username }}
password: ${{ matrix.dockerhub.password }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: wowskarma_api_minimap:latest,wowskarma_api_minimap:$(date +%Y%m%d),wowskarma_api_minimap:$(git rev-parse --short HEAD)

0 comments on commit e941f25

Please sign in to comment.