From 126322859aee0e9284a2d30a128ea0e0fc9bfb34 Mon Sep 17 00:00:00 2001 From: "David H." <22520563+NewJerseyStyle@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:02:20 -0500 Subject: [PATCH] Create release-dockerhub-images.yml for #101 (#102) Skipping code review as adding back a file from earlier commit history --- .../workflows/release-dockerhub-images.yml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/.github/workflows/release-dockerhub-images.yml diff --git a/.github/workflows/.github/workflows/release-dockerhub-images.yml b/.github/workflows/.github/workflows/release-dockerhub-images.yml new file mode 100644 index 000000000..cb7dd220e --- /dev/null +++ b/.github/workflows/.github/workflows/release-dockerhub-images.yml @@ -0,0 +1,45 @@ +# Changes to workflow name require changes to badge URL in README.md +name: Docker image builds + +on: + push: + branches: + - main + - dev + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + env: + # Use native docker command within docker-compose + COMPOSE_DOCKER_CLI_BUILD: 1 + # Use buildkit to speed up docker command + DOCKER_BUILDKIT: 1 + steps: + + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + - name: Checkout + uses: actions/checkout@v2.3.4 + with: + ref: ${{ steps.extranct_branch.outputs.branch }} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Build full project via docker-compose + run: | + mv example.env .env + sed -i 's/compdem/${{ secrets.DOCKER_USERNAME }}/g' docker-compose.yml + docker compose build --parallel --build-arg GIT_HASH=${GITHUB_SHA:0:6} + - name: Push images to Docker Hub + run: docker compose push --ignore-push-failures