Merge pull request #52 from portainer/be-11186/bump-golang-1.23.2 #104
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 compose-unpacker docker image to Portainer CI | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
env: | |
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: staging | |
steps: | |
- name: checkout code | |
uses: actions/[email protected] | |
# https://github.com/docker/setup-qemu-action | |
- name: "[preparation] set up golang" | |
uses: actions/[email protected] | |
with: | |
go-version-file: go.mod | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
with: | |
driver-opts: image=moby/buildkit:v0.10.6 | |
- name: login to docker hub | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
- name: build the image to portainer ci with PR number | |
if: ${{ github.event.pull_request.number != '' }} | |
run: | | |
# make the script executeable | |
chmod +x "${GITHUB_WORKSPACE}/build/build_and_push.sh" | |
# run the script | |
"${GITHUB_WORKSPACE}/build/build_and_push.sh" portainerci pr$GITHUB_PR_NUMBER | |
- name: build the image to portainer ci ( Develop Latest ) | |
if: ${{ github.ref == 'refs/heads/develop' }} | |
run: | | |
# make the script executable | |
chmod +x "${GITHUB_WORKSPACE}/build/build_and_push.sh" | |
# run the script | |
"${GITHUB_WORKSPACE}/build/build_and_push.sh" portainerci develop |