From 088194dc0bbf9a05db5c28cb80e58e731c70cef0 Mon Sep 17 00:00:00 2001 From: Ong Jack Hoe Date: Thu, 30 Nov 2023 11:14:37 +0800 Subject: [PATCH] [GithubActions] Update deploy step --- .github/workflows/build.yml | 31 ++++++++++++++++++++++++- .github/workflows/docker.yml | 44 ------------------------------------ 2 files changed, 30 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9ed4bf..c3a2cf3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: - main jobs: - build-and-push: + build: runs-on: ubuntu-latest steps: - name: Checkout repository @@ -29,3 +29,32 @@ jobs: with: name: build-artifacts path: bin/k6 + + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + name: build-artifacts + path: bin/k6 + + - name: Set up Docker Build + uses: docker/setup-buildx-action@v1 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + env: + IMAGE_NAME: ghcr.io/matrixxsoftware/xk6-diameter:latest + run: | + make docker + docker push $IMAGE_NAME diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 33404d0..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Docker - -on: - workflow_run: - workflows: - - Build - types: - - completed - branches: - - main - -permissions: - contents: read - packages: write - -jobs: - build-and-push: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Download Artifacts - uses: actions/download-artifact@v2 - with: - name: build-artifacts - - - name: Set up Docker Build - uses: docker/setup-buildx-action@v1 - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push Docker image - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile - push: true - tags: ghcr.io/matrixxsoftware/xk6-diameter:latest