Merge pull request #9 from ePages-de/update-actions-to-newer-versions #13
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 package docker image" | |
on: | |
push: | |
branches: [ master, '*-test', 'develop' ] | |
paths: | |
- 'package-action/**' | |
- '.github/workflows/package-docker-image.yaml' | |
jobs: | |
build-docker-image: | |
name: Build and push docker image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.BYD_DOCKERHUB_USER }} | |
password: ${{ secrets.BYD_DOCKERHUB_PASSWORD }} | |
- env: | |
REF: ${{ github.ref }} | |
REPO_NAME: 'ng-action-package-helm-chart' | |
working-directory: './package-action' | |
run: | | |
docker pull "$(grep "^FROM" Dockerfile | cut -d " " -f2)" | |
tag="${GITHUB_REF##*/}" # Branch name | |
image_name="epages/${REPO_NAME}:${tag}" | |
DOCKER_BUILDKIT=1 docker build --no-cache -t "${image_name}" . | |
docker push "${image_name}" |