diff --git a/.github/workflows/build-code.yml b/.github/workflows/build-code.yml index 18240ebc..485cb866 100644 --- a/.github/workflows/build-code.yml +++ b/.github/workflows/build-code.yml @@ -2,6 +2,11 @@ name: Build code on: pull_request: + branches: + - 'main' + push: + branches: + - 'main' workflow_dispatch: permissions: diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 47943977..c8687e32 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -4,9 +4,12 @@ on: push: tags: - '*.*.*' + branches: + - 'main' pull_request: branches: - 'main' + workflow_dispatch: jobs: build_and_push: @@ -15,14 +18,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Docker metadata + - name: Get Meta id: meta - uses: docker/metadata-action@v4 - with: - images: ghostfolio/ghostfolio - tags: | - type=semver,pattern={{major}} - type=semver,pattern={{version}} + run: | + echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT + echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -31,20 +31,24 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 + # - name: Log in to Gitea Docker Registry + # run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login https://gitea.suda.codes -u ${{ secrets.DOCKER_USERNAME }} --password-stdin + - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + registry: gitea.suda.codes + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - name: Build and push uses: docker/build-push-action@v3 with: context: . - platforms: linux/amd64,linux/arm/v7,linux/arm64 + # platforms: linux/amd64,linux/arm/v7,linux/arm64 + platforms: linux/amd64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.output.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + tags: | + gitea.suda.codes/sudacode/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} + gitea.suda.codes/sudacode/${{ steps.meta.outputs.REPO_NAME }}:latest diff --git a/.github/workflows/extract-locales.yml b/.github/workflows/extract-locales.yml deleted file mode 100644 index c17eac5b..00000000 --- a/.github/workflows/extract-locales.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Extract locales - -on: - push: - branches: - - main - -permissions: - contents: write - pull-requests: write - -jobs: - extract_locales: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install dependencies - run: npm ci - - - name: Extract locales - run: npm run extract-locales - - - name: Check changes - id: verify-changed-files - uses: tj-actions/verify-changed-files@v20 - - - name: Create pull request - if: steps.verify-changed-files.outputs.files_changed == 'true' - uses: peter-evans/create-pull-request@v7 - with: - author: 'github-actions[bot] ' - branch: 'feature/update-locales' - commit-message: 'Update locales' - delete-branch: true - title: 'Feature/update locales' - token: ${{ secrets.GITHUB_TOKEN }}