Skip to content

Build docker images #836

Build docker images

Build docker images #836

Workflow file for this run

name: Build docker images
on:
workflow_dispatch:
schedule:
# Every day at 17:30, we udpdate images
- cron: '30 17 * * *'
jobs:
decidim-docker:
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 Last 3 versions of decidim
run: |
npm install -g doctoc
export REGISTRY_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}
export DECIDIM_VERSION_COUNT=${{ secrets.DECIDIM_VERSION_COUNT }}
export REGISTRY_PUSH=true
./update-registry.rb
update-and-publish:
runs-on: ubuntu-latest
needs: [decidim-docker]
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 REGISTRY_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}
export DECIDIM_VERSION_COUNT=${{ secrets.DECIDIM_VERSION_COUNT }}
./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