Weekly image builds #7
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: "Run build and deploy" | |
on: | |
push: | |
branches: [ 'master' ] | |
schedule: | |
- cron: '0 0 * * 1' | |
env: | |
LTS: 20 | |
LATEST: 23 | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18, 19, 20, 21, 22, 23] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Execute image build and push | |
run: | | |
docker build -t ghcr.io/pcvolkmer/jenkins-slave-nodejs:${{matrix.node-version}} ${{matrix.node-version}} | |
docker push ghcr.io/pcvolkmer/jenkins-slave-nodejs:${{matrix.node-version}} | |
- name: Tag and push 'latest' | |
if: ${{matrix.node-version == env.LATEST}} | |
run: | | |
docker tag ghcr.io/pcvolkmer/jenkins-slave-nodejs:${{matrix.node-version}} ghcr.io/pcvolkmer/jenkins-slave-nodejs:latest | |
docker push ghcr.io/pcvolkmer/jenkins-slave-nodejs:latest | |
- name: Tag and push 'lts' | |
if: ${{matrix.node-version == env.LTS}} | |
run: | | |
docker tag ghcr.io/pcvolkmer/jenkins-slave-nodejs:${{matrix.node-version}} ghcr.io/pcvolkmer/jenkins-slave-nodejs:lts | |
docker push ghcr.io/pcvolkmer/jenkins-slave-nodejs:lts |