From 858e7be43fd7e2fac8db603556b36b146913120a Mon Sep 17 00:00:00 2001 From: Hong Viet Le Date: Tue, 26 Dec 2023 11:22:07 +0100 Subject: [PATCH] feat(bats): construction de l'image via GitHub Actions --- .github/workflows/bats.yml | 42 ++++++++++++++++++++++++++++++++++++++ README.md | 2 +- bats/Dockerfile | 3 +++ bats/README.md | 5 +++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/bats.yml create mode 100644 bats/Dockerfile create mode 100644 bats/README.md diff --git a/.github/workflows/bats.yml b/.github/workflows/bats.yml new file mode 100644 index 0000000..2f65234 --- /dev/null +++ b/.github/workflows/bats.yml @@ -0,0 +1,42 @@ +--- +name: Build bats docker image +run-name: ${{ github.actor }} is flying to infinity and beyond 🚀 + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }}/bats + IMAGE_TAG: v1.10.0-curl + +jobs: + build-and-push-docker-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v3.0.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5.1.0 + with: + context: .bats/ + push: false + tags: ${{ env.IMAGE_TAG }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/README.md b/README.md index 660bea4..befd18d 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# Formation-DKADM \ No newline at end of file +# Docker images diff --git a/bats/Dockerfile b/bats/Dockerfile new file mode 100644 index 0000000..406090f --- /dev/null +++ b/bats/Dockerfile @@ -0,0 +1,3 @@ +FROM bats/bats:v1.10.0 + +RUN apk add --no-cache curl diff --git a/bats/README.md b/bats/README.md new file mode 100644 index 0000000..66d2ca4 --- /dev/null +++ b/bats/README.md @@ -0,0 +1,5 @@ +# BATS + +## Pourquoi + +L'image précédemment utilisée `dduportal/bats:0.4.0` n'est plus disponible sur Docker Hub.