build the image and publish on DockerHub #38
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 the image and publish on DockerHub | |
env: | |
IMAGENAME: buffertly/haproxy-quic | |
on: | |
push: | |
branches: [ "main" ] | |
schedule: | |
- cron: '5 18 4 * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: multiarch environment | |
run: | | |
docker run --privileged --rm tonistiigi/binfmt --install all | |
docker buildx create --name multibuilder --driver docker-container --bootstrap | |
docker buildx use multibuilder | |
- name: build and push | |
run: | | |
docker login -u ${{ secrets.DOCKERHUB_USER }} -p ${{ secrets.DOCKERHUB_PASS }} | |
docker buildx build --label=haproxy.version=$(curl -sk https://raw.githubusercontent.com/haproxy/haproxy/master/VERSION) --platform linux/arm64/v8,linux/amd64 -t $IMAGENAME:latest --push . | |
deployment: | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
environment: production | |
steps: | |
- name: deploy | |
run: | | |
curl -s -f -w 'HTTP %{http_code}\n' -X POST ${{ secrets.ZS_WEBHOOK }} | |