Skip to content

Commit

Permalink
update github action versions, autobuild from dockerize branch on push
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed May 28, 2024
1 parent fec78c3 commit ae58e23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Docker Image CI

on:
workflow_dispatch:
push:
branches:
- dockerize
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
Expand All @@ -13,31 +16,31 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set Version
run: |
echo "VERSION=v$(date --rfc-3339=date)" >> ${GITHUB_ENV}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.3.0
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
${{ env.VERSION }}
- name: Build and push Docker image
uses: docker/build-push-action@v3.2.0
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ RUN apt-get update \
RUN a2enmod rewrite
RUN mkdir -p /var/cache/hgresume/ /var/vcs/ && chown -R www-data:www-data /var/cache/hgresume/ /var/vcs/
COPY --chown=www-data api /var/www/html/api/v03/
# cache volume
VOLUME /var/cache/hgresume
# repos volume
VOLUME /var/vcs/public

0 comments on commit ae58e23

Please sign in to comment.