All checks were successful
Build and Push / Build and Push Docker Image (push) Successful in 2m18s
39 lines
1 KiB
YAML
39 lines
1 KiB
YAML
name: Build and Push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
name: Build and Push Docker Image
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Generate image tag
|
|
id: tag
|
|
run: |
|
|
TIMESTAMP=$(date +%s)
|
|
SHORT_SHA=$(git rev-parse --short=7 HEAD | cut -c1-7)
|
|
TAG="main-${TIMESTAMP}-${SHORT_SHA}"
|
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install Docker CLI
|
|
run: |
|
|
apt-get update && apt-get install -y docker.io
|
|
|
|
- name: Build and Push
|
|
run: |
|
|
echo "${{ secrets.FORGEJO_TOKEN }}" | docker login git.mcintire.me -u graham --password-stdin
|
|
|
|
docker build \
|
|
-t "git.mcintire.me/graham/aprs.me:${{ steps.tag.outputs.tag }}" \
|
|
-t "git.mcintire.me/graham/aprs.me:latest" \
|
|
.
|
|
|
|
docker push "git.mcintire.me/graham/aprs.me:${{ steps.tag.outputs.tag }}"
|
|
docker push "git.mcintire.me/graham/aprs.me:latest"
|