Merge pull request #11 from rahulsom/renovate/actions-checkout-4.x #32
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: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
image: | |
- ack | |
- all-jdks | |
- careercup | |
- logstash | |
- pcat | |
- quincykit | |
- rubygems-servlets | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.2.1 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Image | |
working-directory: ${{matrix.image}} | |
run: |- | |
docker build . --file Dockerfile \ | |
--tag ghcr.io/rahulsom/${{matrix.image}}:$(date +%s) \ | |
--tag ghcr.io/rahulsom/${{matrix.image}}:latest | |
- name: Push Image | |
if: github.ref == 'refs/heads/main' | |
working-directory: ${{matrix.image}} | |
run: docker push --all-tags ghcr.io/rahulsom/${{matrix.image}} |