From 529b37e5e41b084788741dabbdfac4e850e80b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20L=C3=BCders?= Date: Sun, 4 Sep 2022 14:42:04 +0200 Subject: [PATCH 1/2] chore(ci): rename main.yaml to ci.yaml --- .github/workflows/{main.yaml => ci.yaml} | 5 +++++ 1 file changed, 5 insertions(+) rename .github/workflows/{main.yaml => ci.yaml} (94%) diff --git a/.github/workflows/main.yaml b/.github/workflows/ci.yaml similarity index 94% rename from .github/workflows/main.yaml rename to .github/workflows/ci.yaml index 3f97c5a..c839b10 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/ci.yaml @@ -16,9 +16,14 @@ on: jobs: # This workflow contains a single job called "build" build: + name: Liting, Testing and building + # The type of runner that the job will run on runs-on: ubuntu-latest + permissions: + contents: read + # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it From 21d7dddde118845b40cb28ea09ed2ad6c9e72c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20L=C3=BCders?= Date: Sun, 4 Sep 2022 14:43:03 +0200 Subject: [PATCH 2/2] chore(ci): adds publish.yaml to container image release --- .github/workflows/publish.yaml | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..5b7db92 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,56 @@ +# This is a basic workflow to help you get started with Actions +name: Publish Container Image + +# Controls when the workflow will run +on: + # Triggers the workflow when a release is published + release: + types: [ "published" ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "push_to_registries" + push_to_registries: + name: Push Docker image to multiple registries + + # The type of runner that the job will run on + runs-on: ubuntu-latest + + permissions: + packages: write + contents: read + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: 📥 Check out the code + uses: actions/checkout@v3 + + - name: 🔑 Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: 🔑 Log in to the GH Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: 🔎 Extract metadata (tags, labels) for Container + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} + + - name: 🧰 Build and push Container images + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file