Update docker-image.yml #9
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
name: Build and Push Docker Image to Docker Hub | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: docker.io | |
# github.repository as <account>/<repo> | |
IMAGE_NAME: ${{ github.repository }} | |
REPO_BASE: ${{ vars.REPO_BASE }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: Build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Show base | |
run: echo "$GITHUB_CONTEXT" | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login ZP Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.ZPDOCKER_REGISTRY }} | |
username: ${{ secrets.ZPDOCKER_USERNAME }} | |
password: ${{ secrets.ZPDOCKER_PASSWORD }} | |
- name: Build the Docker image | |
run: ./k8s/build.sh v1.0.0 |