Skip to content

Commit

Permalink
Fix nesting bug in ci.yml triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
mmgoodnow committed Apr 20, 2024
1 parent fe95a86 commit 3847cc3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 74 deletions.
124 changes: 62 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
name: ci

on:
push:
branches:
- "**"
tags:
- "v*"
push:
branches:
- "**"
tags:
- "v*"
pull_request:
branches:
- "master"
branches:
- "master"
workflow_dispatch:

permissions:
packages: write
contents: read
packages: write
contents: read

jobs:
native:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run lint
- run: npm run typecheck
native:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run lint
- run: npm run typecheck

docker:
environment: Docker Hub
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/cross-seed
crossseed/cross-seed
tags: |
type=semver,pattern=version-{{version}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=ref,event=pr
- name: Set up QEMU dependency
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: ${{ !github.event.pull_request.head.repo.fork }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
docker:
environment: Docker Hub
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/cross-seed
crossseed/cross-seed
tags: |
type=semver,pattern=version-{{version}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=ref,event=pr
- name: Set up QEMU dependency
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: ${{ !github.event.pull_request.head.repo.fork }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
13 changes: 1 addition & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,7 @@
"prettier": {
"tabWidth": 4,
"useTabs": true,
"proseWrap": "always",
"overrides": [
{
"files": [
"*.yaml",
"*.yml"
],
"options": {
"tabWidth": 2
}
}
]
"proseWrap": "always"
},
"lint-staged": {
"*.{js,ts}": "eslint --cache",
Expand Down

0 comments on commit 3847cc3

Please sign in to comment.