forked from mendhak/docker-http-https-echo
-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (52 loc) · 2.21 KB
/
master-latest.yml
File metadata and controls
62 lines (52 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: master-latest
on:
push:
branches: [ "master" ]
schedule:
- cron: '0 3 * * *' # Scheduled runs every day at 3am UTC
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }} # github username or org
password: ${{ secrets.GITHUB_TOKEN }} # github actions builtin token. repo has to have pkg access.
- name: Prepare
id: prep
run: |
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
pull: true # avoid bitrot with repeated cache hits
push: true
tags: ghcr.io/${{ github.repository_owner }}/http-echo:latest,ghcr.io/${{ github.repository_owner }}/http-echo:${{ github.sha }},${{ github.repository_owner }}/http-echo:latest,${{ github.repository_owner }}/http-echo:${{ github.sha }}
labels: |
org.opencontainers.image.title=http-echo
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
cache-from: type=gha # all-automatic Github Actions caching
cache-to: type=gha,mode=max