From 18851242789c5f463907a80ad349dcb3619f0cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Bourgeois?= <89983767+JeromeMBourgeois@users.noreply.github.com> Date: Tue, 30 Jul 2024 09:13:24 +0200 Subject: [PATCH] add githubAction for docker --- .github/workflows/docker.yml | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..50ce781 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,67 @@ +name: Docker + +on: + release: + types: [created] + branches: + - main + +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + matrix: + node: [16] + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - run: npm install --force + - run: npm run build + + - name: Upload Deploy Artifact + uses: actions/upload-artifact@v2 + with: + name: build + path: build/ + + docker: + name: Docker Build and Push + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v2 + + - name: Download Build + uses: actions/download-artifact@v2 + with: + name: build + path: build + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract Version + run: | + VERSION=$(cat package.json | jq -r .version) + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Build and Push + uses: docker/build-push-action@v4 + with: + push: true + file: Dockerfile + tags: inseefr/impala:${{ env.VERSION }} \ No newline at end of file