forked from compdemocracy/polis
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'edge-civictechto' into feature/release2DockerHub-issue-101
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
.github/workflows/.github/workflows/release-dockerhub-images.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] | ||
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 |