From 77c1a8318512139530786c3b7210eabfc47f50b5 Mon Sep 17 00:00:00 2001 From: Alex dos Santos Xavier Date: Sat, 12 Aug 2023 17:48:56 -0300 Subject: [PATCH 01/10] Create release.yml --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ca56030 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Testing Publish Docker image + +on: + pull_request: + branches: [ "main" ] +# release: +# types: [published] + +jobs: + push_to_docker_hub: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: powersjk/pavlov-stats + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: ./WebApplication1/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + From ab88541f816076d7b069aaf8c9e53c6f1e60b0cf Mon Sep 17 00:00:00 2001 From: Alex dos Santos Xavier Date: Sun, 13 Aug 2023 01:23:10 -0300 Subject: [PATCH 02/10] Update release.yml --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca56030..b4e20f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,7 @@ on: jobs: push_to_docker_hub: + if: false name: Push Docker image to Docker Hub runs-on: ubuntu-latest @@ -35,5 +36,34 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + update_oci_env: + name: Update Oracle Environment + runs-on: ubuntu-latest + env: + OCI_CLI_USER: ${{ secrets.OCI_USER }} + OCI_CLI_TENANCY: ${{ secrets.OCI_TENANCY }} + OCI_CLI_FINGERPRINT: ${{ secrets.OCI_FINGERPRINT }} + OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_API_KEY }} + OCI_CLI_REGION: ${{ secrets.OCI_REGION }} + + steps: + - name: Retrieve the OCID of a named compartment in tenancy + uses: oracle-actions/run-oci-cli-command@v1.1.1 + id: find-compartment-id + with: + command: 'iam compartment list --compartment-id-in-subtree=true' + query: "data[?name=='Pavlov Shack Live'].id" + + - name: Retrieve the display name and shape of the instances in my compartment + uses: oracle-actions/run-oci-cli-command@v1.1.1 + id: find-instances + with: + command: 'compute instance list --compartment-id ${{ steps.find-compartment-id.outputs.raw_output }}' + query: 'data[*].{name: \"display-name\", shape: shape}' + + - name: List the display name and shape of the instances in my compartment + run: | + echo ${{ steps.find-instances.outputs.output }} | jq . From d7de78ea93b081b078068598954f990e35070310 Mon Sep 17 00:00:00 2001 From: Alex dos Santos Xavier Date: Sun, 13 Aug 2023 02:11:14 -0300 Subject: [PATCH 03/10] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4e20f6..aa2c84d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,7 +53,7 @@ jobs: id: find-compartment-id with: command: 'iam compartment list --compartment-id-in-subtree=true' - query: "data[?name=='Pavlov Shack Live'].id" + query: "data[?name=='testing'].id" - name: Retrieve the display name and shape of the instances in my compartment uses: oracle-actions/run-oci-cli-command@v1.1.1 From 2ba525a1d5b93dec30e167c5979121656e917823 Mon Sep 17 00:00:00 2001 From: Alex dos Santos Xavier Date: Sun, 13 Aug 2023 03:10:36 -0300 Subject: [PATCH 04/10] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa2c84d..0dbbffe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,7 +53,7 @@ jobs: id: find-compartment-id with: command: 'iam compartment list --compartment-id-in-subtree=true' - query: "data[?name=='testing'].id" + query: "data[?name=='${{ secrets.OCI_REGION }}'].id" - name: Retrieve the display name and shape of the instances in my compartment uses: oracle-actions/run-oci-cli-command@v1.1.1 From 3f82b9600a6c137b0cf1a81839dd8b0894fa96f7 Mon Sep 17 00:00:00 2001 From: Alex dos Santos Xavier Date: Sun, 13 Aug 2023 03:26:11 -0300 Subject: [PATCH 05/10] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0dbbffe..191bd38 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,7 +53,7 @@ jobs: id: find-compartment-id with: command: 'iam compartment list --compartment-id-in-subtree=true' - query: "data[?name=='${{ secrets.OCI_REGION }}'].id" + query: "data[?name=='${{ secrets.OCI_COMPARTMENT }}'].id" - name: Retrieve the display name and shape of the instances in my compartment uses: oracle-actions/run-oci-cli-command@v1.1.1 From 625c98d689c313a6adc5064c473e30a4b18665f5 Mon Sep 17 00:00:00 2001 From: Alex dos Santos Xavier Date: Thu, 17 Aug 2023 01:18:37 -0300 Subject: [PATCH 06/10] Update release.yml Adding platform ARM64 to docker --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 191bd38..be1ca0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,6 @@ on: jobs: push_to_docker_hub: - if: false name: Push Docker image to Docker Hub runs-on: ubuntu-latest @@ -32,6 +31,7 @@ jobs: uses: docker/build-push-action@v4 with: context: . + platforms: linux/amd64,linux/arm64/v8 file: ./WebApplication1/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} From 05e7a3f3539cd41c8e0c97fdb713b24e47e9180a Mon Sep 17 00:00:00 2001 From: Alex dos Santos Xavier Date: Thu, 17 Aug 2023 01:28:48 -0300 Subject: [PATCH 07/10] Update release.yml Adding new platform --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be1ca0b..0b01145 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,12 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Log in to Docker Hub uses: docker/login-action@v2 From 2308f982308ecb8b393c013b31fe140071f30b6a Mon Sep 17 00:00:00 2001 From: Alex dos Santos Xavier Date: Thu, 17 Aug 2023 01:50:59 -0300 Subject: [PATCH 08/10] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b01145..1f953d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: uses: docker/build-push-action@v4 with: context: . - platforms: linux/amd64,linux/arm64/v8 + platforms: linux/amd64,linux/arm64 file: ./WebApplication1/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} From c9e9bda80013a069fac866d6938e2b596a7139bf Mon Sep 17 00:00:00 2001 From: Alex dos Santos Xavier Date: Thu, 17 Aug 2023 01:55:38 -0300 Subject: [PATCH 09/10] Removing QEMU .NET isn't supported in QEMU https://github.com/dotnet/dotnet-docker/issues/3832 --- .github/workflows/release.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1f953d8..979798f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,12 +14,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - name: Log in to Docker Hub uses: docker/login-action@v2 @@ -33,11 +27,21 @@ jobs: with: images: powersjk/pavlov-stats - - name: Build and push Docker image + - name: Build and push Docker image linux/amd64 + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64 + file: ./WebApplication1/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push Docker image linux/arm64 uses: docker/build-push-action@v4 with: context: . - platforms: linux/amd64,linux/arm64 + platforms: linux/arm64 file: ./WebApplication1/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} From e6cfe8f3a7ed915ae4ee1de02cd8dfd075615520 Mon Sep 17 00:00:00 2001 From: Alex dos Santos Xavier Date: Thu, 17 Aug 2023 20:16:52 -0300 Subject: [PATCH 10/10] Using QEMU and buildx to build multiplatform --- .github/workflows/release.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 979798f..46be5e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,12 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Log in to Docker Hub uses: docker/login-action@v2 @@ -27,21 +33,11 @@ jobs: with: images: powersjk/pavlov-stats - - name: Build and push Docker image linux/amd64 - uses: docker/build-push-action@v4 - with: - context: . - platforms: linux/amd64 - file: ./WebApplication1/Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - - name: Build and push Docker image linux/arm64 + - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: . - platforms: linux/arm64 + platforms: linux/amd64,linux/arm64 file: ./WebApplication1/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }}