|
1 | | -name: Docker |
| 1 | +name: Docker Publish |
2 | 2 |
|
3 | 3 | on: |
4 | | - schedule: |
5 | | - - cron: '38 6 * * *' |
6 | 4 | push: |
7 | 5 | branches: [ "main" ] |
8 | 6 | tags: [ 'v*.*.*' ] |
9 | | - pull_request: |
10 | | - branches: [ "main" ] |
11 | | - |
12 | | -env: |
13 | | - REGISTRY: ghcr.io |
14 | | - IMAGE_NAME: ${{ github.repository }} |
15 | 7 |
|
16 | 8 | jobs: |
17 | 9 | build: |
18 | | - runs-on: ubuntu-latest |
19 | | - |
20 | | - permissions: |
21 | | - contents: read |
22 | | - packages: write |
23 | | - |
24 | | - steps: |
25 | | - - name: Checkout repository |
26 | | - uses: actions/checkout@v3 |
27 | | - with: |
28 | | - submodules: true |
29 | | - |
30 | | - - name: Setup Docker buildx |
31 | | - uses: docker/setup-buildx-action@v2 |
32 | | - |
33 | | - - name: Log into registry ${{ env.REGISTRY }} |
34 | | - if: github.event_name != 'pull_request' |
35 | | - uses: docker/login-action@v2 |
36 | | - with: |
37 | | - registry: ${{ env.REGISTRY }} |
38 | | - username: ${{ github.actor }} |
39 | | - password: ${{ secrets.GITHUB_TOKEN }} |
40 | | - |
41 | | - - name: Extract Docker metadata |
42 | | - id: meta |
43 | | - uses: docker/metadata-action@v4 |
44 | | - with: |
45 | | - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
46 | | - # This will result in the latest tagged version being released as |
47 | | - # vX.Y.Z, vX.Y, and latest. The most recent commit on main will also |
48 | | - # be tagged as edge. |
49 | | - tags: | |
50 | | - type=edge,branch=main |
51 | | - type=semver,pattern={{version}} |
52 | | - type=semver,pattern={{major}}.{{minor}} |
53 | | -
|
54 | | - - name: Build and push Docker image |
55 | | - id: build-and-push |
56 | | - uses: docker/build-push-action@v4 |
57 | | - with: |
58 | | - context: . |
59 | | - push: ${{ github.event_name != 'pull_request' }} |
60 | | - tags: ${{ steps.meta.outputs.tags }} |
61 | | - labels: ${{ steps.meta.outputs.labels }} |
62 | | - cache-from: type=gha |
63 | | - cache-to: type=gha,mode=max |
| 10 | + uses: seabird-chat/ci/.github/workflows/docker-publish.yml@main |
0 commit comments