ci
All checks were successful
build image / build image (push) Successful in 39s

This commit is contained in:
jeff 2024-06-04 00:49:35 -07:00
parent 084388d3b8
commit bed03dd1ee
Signed by: jeff
GPG Key ID: 6672802D9BEE23CB
2 changed files with 35 additions and 33 deletions

View File

@ -1,33 +1,35 @@
name: build image
on:
push:
branches:
- master
push:
branches:
- master
jobs:
build image:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: code checkout
uses: actions/checkout@v3
- name: docker login
uses: docker/login-action@v2
with:
registry: registry.digitalocean.com
username: ${{ secrets.DOCKER_REGISTRY_CREDS }}
password: ${{ secrets.DOCKER_REGISTRY_CREDS }}
- name: create tag
id: create-tag
run: |
tag=$(echo ${{ github.sha }} | cut -b 1-8)
echo "::set-output name=tag::$tag"
- name: build and push
uses: docker/build-push-action@master
with:
platforms: linux/amd64
push: true
tags: |
registry.digitalocean.com/ssdocker/${{ github.repository }}:${{ steps.create-tag.outputs.tag }}
registry.digitalocean.com/ssdocker/${{ github.repository }}:latest
build image:
runs-on: ubuntu-latest
steps:
- name: code checkout
uses: actions/checkout@v4.1.6
- name: docker login
uses: docker/login-action@v2
with:
registry: registry.digitalocean.com
username: ${{ secrets.DOCKER_REGISTRY_CREDS }}
password: ${{ secrets.DOCKER_REGISTRY_CREDS }}
- name: create tag
id: create-tag
run: |
tag=$(echo ${{ github.sha }} | cut -b 1-8)
echo "::set-output name=tag::$tag"
- name: build and push
uses: docker/build-push-action@v5.3.0
with:
platforms: linux/amd64
push: true
build-args: |
REGISTRY_DOCKER_HUB=${{ vars.REGISTRY_DOCKER_HUB }}
REGISTRY_GCR=${{ vars.REGISTRY_GCR }}
REGISTRY_SIMPLE_SYSTEMS=${{ vars.REGISTRY_SIMPLE_SYSTEMS }}
tags: |
registry.digitalocean.com/ssdocker/${{ github.repository }}:${{ steps.create-tag.outputs.tag }}
registry.digitalocean.com/ssdocker/${{ github.repository }}:latest

View File

@ -1,5 +1,6 @@
# STEP 1: Build the website's files
FROM alpine:latest AS build-website
ARG REGISTRY_DOCKER_HUB
ARG REGISTRY_SIMPLE_SYSTEMS
FROM $REGISTRY_DOCKER_HUB/alpine:latest AS build-website
WORKDIR /src
@ -12,8 +13,7 @@ RUN apk update && apk upgrade && \
RUN hugo --minify
# STEP 2: Add static files to webserver image
FROM registry.digitalocean.com/ssdocker/simplesystems/static-web-server:latest
FROM $REGISTRY_SIMPLE_SYSTEMS/simplesystems/static-web-server:609f2b47
WORKDIR /app