Build docker images #308
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
name: Build docker images | |
on: | |
workflow_dispatch: | |
schedule: | |
# Every day at 17:30, we udpdate images | |
- cron: '30 17 * * *' | |
jobs: | |
decidim-026: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Publish Decidim 026 | |
run: | | |
npm install -g doctoc | |
export REGISTERY_USERNAME=${{ secrets.DOCKERHUB_USERNAME }} | |
export DECIDIM_VERSION_BRANCHES=release/0.26-stable | |
export REGISTERY_PUSH=true | |
./update-registery.rb | |
decidim-027: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Publish Decidim 027 | |
run: | | |
npm install -g doctoc | |
export REGISTERY_USERNAME=${{ secrets.DOCKERHUB_USERNAME }} | |
export DECIDIM_VERSION_BRANCHES=release/0.27-stable | |
export REGISTERY_PUSH=true | |
./update-registery.rb | |
decidim-develop: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Publish Decidim Develop | |
run: | | |
npm install -g doctoc | |
export REGISTERY_USERNAME=${{ secrets.DOCKERHUB_USERNAME }} | |
export DECIDIM_VERSION_BRANCHES=develop | |
export REGISTERY_PUSH=true | |
./update-registery.rb | |
update-and-publish: | |
runs-on: ubuntu-latest | |
needs: [decidim-026, decidim-027, decidim-develop] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Update README | |
run: | | |
npm install -g doctoc | |
export REGISTERY_USERNAME=${{ secrets.DOCKERHUB_USERNAME }} | |
export DECIDIM_VERSION_BRANCHES=release/0.26-stable,release/0.27-stable,develop | |
./update-documentation.rb | |
- name: Push README | |
run: | | |
docker run --rm -e DOCKER_USER=${{ secrets.DOCKERHUB_USERNAME }} \ | |
-v $(pwd):/myvol \ | |
-e DOCKER_PASS=${{ secrets.DOCKERHUB_TOKEN }} \ | |
-e PUSHRM_SHORT="Decidim docker images" \ | |
-e PUSHRM_TARGET="docker.io/${{ secrets.DOCKERHUB_USERNAME }}/decidim" \ | |
-e PUSHRM_DEBUG=1 \ | |
-e PUSHRM_FILE=/myvol/README.md chko/docker-pushrm | |
- name: Commit and push changes | |
run: | | |
git config --global user.name "Github Actions" | |
git config --global user.email "[email protected]" | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Update files from update script" | |
git push | |