metadata/.github/workflows/ci.yml

34 lines
899 B
YAML
Raw Normal View History

2024-04-04 20:09:04 +00:00
name: ci
on:
- push
jobs:
docker:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
2025-02-25 19:56:29 +00:00
permissions:
contents: read
packages: write
2024-04-04 20:09:04 +00:00
steps:
2025-02-25 20:57:13 +00:00
- name: create .npmrc
2025-02-25 21:01:52 +00:00
run: echo -e "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}\n@preservetube:registry=https://npm.pkg.github.com/" > .secret_npmrc
2025-02-25 20:46:54 +00:00
2024-04-04 20:09:04 +00:00
- name: Login to GitHub Container Registry
2025-02-25 20:46:54 +00:00
uses: docker/login-action@v2
2024-04-04 20:09:04 +00:00
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
2025-02-25 19:56:29 +00:00
password: ${{ secrets.GITHUB_TOKEN }}
2024-04-04 20:09:04 +00:00
- name: Set up Docker Buildx
2025-02-25 20:46:54 +00:00
uses: docker/setup-buildx-action@v2
2024-04-04 20:09:04 +00:00
- name: Build and push
2025-02-25 20:46:54 +00:00
uses: docker/build-push-action@v5
2024-04-04 20:09:04 +00:00
with:
push: true
2025-02-25 20:57:13 +00:00
secret-files: |
"npmrc=./.secret_npmrc"
tags: ghcr.io/${{ github.repository }}:latest