From f531488baf0273041ed3f46b7578ac3bfa9833d9 Mon Sep 17 00:00:00 2001 From: Harry <14015057+HarryVasanth@users.noreply.github.com> Date: Thu, 22 Jun 2023 17:46:11 +0100 Subject: [PATCH] feat(workflow): ci/cd on `master` --- .github/workflows/docker-image.yml | 29 ------------------ .github/workflows/ga-image-build-master.yml | 33 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/docker-image.yml create mode 100644 .github/workflows/ga-image-build-master.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index d919a70..0000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Docker Image CI - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build the Docker image - run: | - docker build tests/ --file tests/Dockerfile --tag ghcr.io/01-edu/test-blockchain:latest - # docker run ghcr.io/01-edu/test-blockchain:latest - docker push ghcr.io/01-edu/test-blockchain:latest diff --git a/.github/workflows/ga-image-build-master.yml b/.github/workflows/ga-image-build-master.yml new file mode 100644 index 0000000..2baae10 --- /dev/null +++ b/.github/workflows/ga-image-build-master.yml @@ -0,0 +1,33 @@ +name: 🐳 On Master - Build and Test Docker Image + +on: + push: + branches: ["master"] + +jobs: + build-image: + name: 🏗️ Build Image + runs-on: ubuntu-latest + + steps: + - name: 🐧 Checkout + uses: actions/checkout@v3 + + - name: 📦 Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: 🐳 Login to docker.01-edu.org Registry + uses: docker/login-action@v2 + with: + registry: docker.01-edu.org + username: ${{ secrets.USER_DOCKER_01EDU_ORG }} + password: ${{ secrets.SECRET_DOCKER_01EDU_ORG }} + + - name: 🏗️ Build the Branch-Blockchain Docker image + run: | + docker build tests/ --file tests/Dockerfile --tag ghcr.io/01-edu/test-blockchain:latest + docker push ghcr.io/01-edu/test-blockchain:latest