Skip to content

sec: simplified CIMD login flow #146

sec: simplified CIMD login flow

sec: simplified CIMD login flow #146

Workflow file for this run

name: CI
on:
pull_request:
push:
permissions:
contents: read
packages: write
jobs:
build:
name: Test and build image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-go@v7.0.0
with:
go-version-file: go.mod
- name: Download dependencies
run: go mod download
- name: Test
run: go test ./...
- name: Set up QEMU
uses: docker/setup-qemu-action@v4.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4.3.0
- name: Log in to GitHub Container Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish image
uses: docker/build-push-action@v7.3.0
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
tags: ghcr.io/trly/pkgdepot:latest
labels: |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}