-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf3a4f7
commit b6a0158
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build & Publish to Docker Hub | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag from which build images' | ||
required: true | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
docker: | ||
name: Build & Publish ${{ matrix.docker.name }} to Docker Hub | ||
strategy: | ||
matrix: | ||
docker: | ||
- { name: Hiker's Book UI, target: ui-hikers-book, image: radoslavirha/hikers-book-ui-hikers-book } | ||
- { name: Authentication API, target: api-authentication, image: radoslavirha/hikers-book-api-authentication } | ||
- { name: GraphQL API, target: api-graphql, image: radoslavirha/hikers-book-api-graphql } | ||
- { name: Stages API, target: api-stages, image: radoslavirha/hikers-book-api-stages } | ||
- { name: Trips API, target: api-trips, image: radoslavirha/hikers-book-api-trips } | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.tag }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./infra/docker/Dockerfile | ||
# platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ matrix.docker.image }}:${{ github.event.inputs.tag }},${{ matrix.docker.image }}:latest | ||
target: ${{ matrix.docker.target }} |