-
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.
Merge pull request #3 from datlt4/feature/login
BUG UPDATE: add authentication
- Loading branch information
Showing
29 changed files
with
2,009 additions
and
37 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: ci | ||
|
||
on: | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
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,58 @@ | ||
name: CI | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the main branch | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
strategy: | ||
matrix: | ||
platform: | ||
- linux/amd64 | ||
- linux/arm64 | ||
# - linux/arm/v7 | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 # Checkout the repository code | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 # (Optional) Setup QEMU if needed | ||
with: | ||
platforms: ${{ matrix.platform }} | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 # (Optional) Setup Docker Buildx if needed | ||
with: | ||
driver-opts: network=host | ||
- | ||
name: Login to Dockerhub # https://docs.docker.com/build/ci/github-actions/push-multi-registries/ | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.ZXZ_DOCKERHUB_PAT }} | ||
- | ||
name: Declare some variables | ||
shell: bash | ||
run: | | ||
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | ||
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV" | ||
echo "repository_name=$(basename `git rev-parse --show-toplevel`)" >> "$GITHUB_ENV" | ||
echo "platform=$(echo ${{ matrix.platform }} | tr -d '/' | tr -d 'linux')" >> "$GITHUB_ENV" | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . # Docker context (path to Dockerfile and build context) | ||
platforms: ${{ matrix.platform }} | ||
file: ./Dockerfile # Path to Dockerfile (if not in the root) | ||
push: false # Push the built image to a registry # ${{ github.event_name != 'pull_request' }} | ||
tags: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.repository_name }}:${{ env.sha_short }}-${{ env.platform }} |
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
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
Oops, something went wrong.