-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (33 loc) · 1.17 KB
/
container.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
name: "CI and deployment"
on: [push]
jobs:
ci-and-release:
name: "CI and release"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
USERNAME: ${{ github.actor }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v1
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ github.token }}
- name: "Build e publicação do container"
env:
TAG: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
if: github.ref_type == 'tag'
run: |
nix build .#container && ./result | docker load
docker tag $( docker image ls -f reference=ts-proxy --format '{{.ID}}' ) ${{ env.TAG }}:$( docker image ls -f reference=ts-proxy --format '{{.Tag}}' )
docker push ${{ env.TAG }}:$( docker image ls -f reference=ts-proxy --format '{{.Tag}}' )