-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (50 loc) · 1.53 KB
/
Copy pathdocker-image.yml
File metadata and controls
55 lines (50 loc) · 1.53 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
name: Docker Image CI
on:
push:
branches: ["master"]
paths-ignore:
- .github/workflows/helm-chart-publish.yml
- .github/workflows/release.yml
- charts/**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Get Latest Version
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
with:
semver_only: true
initial_version: 0.0.0
with_initial_version: true
- name: Get New Version
uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
with:
current_version: ${{ steps.get-latest-tag.outputs.tag }}
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
push: ${{ github.ref == 'refs/heads/master' }}
tags: ghcr.io/michaelsp/timelimit-server/timelimit:${{ steps.bump-semver.outputs.new_version }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.bump-semver.outputs.new_version }}