diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2024-05-22 20:42:02 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2024-05-22 20:57:07 +0300 |
commit | 07ccc915fedfe276fc59aaa9d9b7bf1657483709 (patch) | |
tree | 4b661e06986cf7639b68b9db6fa0503197ec3512 | |
parent | remove packages preferences (diff) | |
download | soko-07ccc915fedfe276fc59aaa9d9b7bf1657483709.tar.gz soko-07ccc915fedfe276fc59aaa9d9b7bf1657483709.tar.bz2 soko-07ccc915fedfe276fc59aaa9d9b7bf1657483709.zip |
ci: add github actions builder
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r-- | .github/workflows/ci.yml | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7bf2e62 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: ci + +on: + push: + branches: [master,develop] + +jobs: + test-go: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: 1.22.2 + cache-dependency-path: go.sum + - name: Test + run: go test -v ./pkg/models/... + + docker: + needs: ["test-go"] + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - file: Dockerfile + type: web + - file: Dockerfile.updater + type: updater + + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/gentoo/soko + tags: | + type=sha,prefix={{branch}}-${{ matrix.type }}- + type=raw,value={{branch}}-${{ matrix.type }}-latest + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ matrix.file }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} |