-
Notifications
You must be signed in to change notification settings - Fork 144
74 lines (66 loc) · 2.39 KB
/
docker.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Docker
on:
push:
branches:
- master
jobs:
docker:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- name: Setup Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build flatpak
run: |
sudo apt-get update
sudo apt-get install -y flatpak-builder
cd docker
bash -x ./build.sh
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: docker
file: docker/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/flathub-infra/flatpak-builder-lint:${{ github.sha }}
ghcr.io/flathub-infra/flatpak-builder-lint:latest
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=ssh://[email protected]:${{ github.repository }}.git
org.opencontainers.image.url=https://github.com/${{ github.repository }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Login to ghcr.io using Flathub credentials
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.FLATHUB_ORG_USER }}
password: ${{ secrets.FLATHUB_ORG_TOKEN }}
- name: Build and push Docker image to the old location
uses: docker/build-push-action@v5
with:
context: docker
file: docker/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/flathub/flatpak-builder-lint:${{ github.sha }}
ghcr.io/flathub/flatpak-builder-lint:latest
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=ssh://[email protected]:${{ github.repository }}.git
org.opencontainers.image.url=https://github.com/${{ github.repository }}
cache-from: type=gha
cache-to: type=gha,mode=max