Merge pull request #28 from lucasew/dep-update #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}}' ) |