[Feature][pull]: pull haproxy image #39
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: Docker Image Pull | |
on: | |
push: | |
branches: [ "main" ] | |
paths: [ | |
".github/workflows/docker_pull.yml", | |
] | |
pull_request: | |
branches: [ "main" ] | |
types: [opened, synchronize, closed] | |
paths: [ | |
".github/workflows/docker_pull.yml", | |
] | |
env: | |
VERSION: 3.1.0 | |
IMAGE_SRC: questdb/questdb:6.0.4 | |
IMAGE_INTERMEDIUM: saz0568/zelos-image:questdb-questdb-6.0.4 | |
IMAGE_DEST: harbor.zelostech.com.cn:5443/devops/questdb/questdb:6.0.4 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2.1.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Delete huge unnecessary tools folder | |
run: rm -rf /opt/hostedtoolcache | |
- name: Pull Docker images | |
run: docker pull ${{ env.IMAGE_SRC }} | |
- name: Tag Docker images | |
run: docker tag ${{ env.IMAGE_SRC }} ${{ env.IMAGE_INTERMEDIUM }} | |
- name: Push Docker images | |
run: docker push ${{ env.IMAGE_INTERMEDIUM }} | |
publish: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.pull_request.merged == true }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2.1.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Delete huge unnecessary tools folder | |
run: rm -rf /opt/hostedtoolcache | |
- name: Pull Docker image from DockerHub | |
run: docker pull ${{ env.IMAGE_INTERMEDIUM }} | |
- name: Log in to zelos Harbor | |
run: echo "${{ secrets.HARBOR_PASSWORD }}" | docker login harbor.zelostech.com.cn:5443 --username=${{ secrets.HARBOR_USERNAME }} --password-stdin | |
- name: Tag Harbor images | |
run: docker tag ${{ env.IMAGE_INTERMEDIUM }} ${{ env.IMAGE_DEST }} | |
- name: Push Harbor images | |
run: docker push ${{ env.IMAGE_DEST }} |