47 lines
1.0 KiB
YAML
47 lines
1.0 KiB
YAML
name: Container Build & Push
|
|
|
|
# add on pull requests too
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
env:
|
|
REGISTRY: www.gitgud.foo
|
|
OWNER: thegrind
|
|
TAG: 1.0.0
|
|
IMAGE_NAME: test
|
|
steps:
|
|
-
|
|
name: Check out code
|
|
uses: actions/checkout@v3
|
|
- name: whereami
|
|
run: ls -lath
|
|
|
|
-
|
|
name: get dicks space
|
|
run: |
|
|
df -h
|
|
|
|
-
|
|
name: Log in to the GitGud container registry
|
|
run: |
|
|
/usr/bin/docker login $REGISTRY \
|
|
-u "${{ gitea.actor }}" \
|
|
-p "${{ secrets.REGISTRY_PASSWORD }}"
|
|
|
|
-
|
|
name: Build and push OCI image
|
|
run: |
|
|
IMAGE=$REGISTRY/$OWNER/$IMAGE_NAME:$TAG
|
|
docker build -t $IMAGE .
|
|
-
|
|
name: Push OCI image
|
|
run: |
|
|
IMAGE=$REGISTRY/$OWNER/$IMAGE_NAME:$TAG
|
|
docker push $IMAGE |