31 lines
896 B
YAML
31 lines
896 B
YAML
|
name: Build docker container
|
||
|
on:
|
||
|
push:
|
||
|
branches:
|
||
|
- main
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
name: Build image
|
||
|
runs-on: ubuntu-latest
|
||
|
container: ghcr.io/catthehacker/ubuntu:act-latest
|
||
|
env:
|
||
|
IMAGE_NAME: ip-svc
|
||
|
REGISTRY: git.mzsl.nl
|
||
|
REPO_OWNER: mans
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v4
|
||
|
- name: Login to Docker Hub
|
||
|
uses: docker/login-action@v3
|
||
|
with:
|
||
|
registry: git.mzsl.nl
|
||
|
username: ${{ secrets.LOGIN_USER }}
|
||
|
password: ${{ secrets.LOGIN_PASS }}
|
||
|
- name: Build and push
|
||
|
run: |
|
||
|
TODAY=$(date +'%Y-%m-%d')
|
||
|
docker build -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:${TODAY} -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest .
|
||
|
docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:${TODAY}
|
||
|
docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest
|