Merge pull request #86 from green-ecolution/fix/update-current-projec… #97
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 Develop | |
"on": | |
push: | |
paths: | |
- "**/**" | |
- "!.github/**" | |
- "!k8s/**" | |
- "!.dockerignore" | |
- "!.editorconfig" | |
- "!.gitignore" | |
- "!.node-version" | |
- "!CHANGELOG.md" | |
- "!README.md" | |
branches: | |
- develop | |
jobs: | |
build_and_deploy_dev: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
actions: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set commit sha | |
run: | | |
echo "COMMIT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: set lower case owner name | |
run: | | |
echo "REPO_LC=${REPO,,}" >>${GITHUB_ENV} | |
env: | |
REPO: "${{ github.repository }}" | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./.docker/Dockerfile.dev | |
platforms: linux/amd64 | |
push: true | |
tags: ghcr.io/${{ env.REPO_LC }}-dev:latest, ghcr.io/${{ env.REPO_LC }}-dev:${{ env.COMMIT_SHA }} | |
- name: "Setup yq" | |
uses: dcarbone/[email protected] | |
with: | |
version: "v4.42.1" | |
force: true | |
- name: Initialize mandatory git config | |
run: | | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email '[email protected]' | |
- name: Bump version in values/develop.yaml | |
run: yq -i '.deployment.image.tag=strenv(COMMIT_SHA)' ./k8s/values/develop.yaml | |
- name: Commit k8s values files | |
id: make-commit | |
run: | | |
git add ./k8s/values/develop.yaml | |
git commit --message "chore: update dev image to commit ${{ env.COMMIT_SHA }}" | |
echo "::set-output name=commit::$(git rev-parse HEAD)" | |
- name: Push changes | |
uses: CasperWA/push-protected@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: develop |