Build and Publish #265
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Checkout gotosocial into tmp | |
uses: actions/checkout@v2 | |
with: | |
repository: gotosocial/gotosocial | |
path: ./gotosocial | |
fetch-depth: 0 | |
- name: Setup nodejs | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Apply patches | |
run: | | |
cd gotosocial | |
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
git config --global user.name "${{ github.actor }}" | |
git am ../patches/*.patch | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Build go binaries | |
run: | | |
./scripts/build.sh | |
working-directory: ./gotosocial | |
- name: Setup buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Github Packages | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build image and push to GitHub Container Registry | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./gotosocial | |
file: ./gotosocial/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
tags: ghcr.io/thekitty-zone/custom-gotosocial:latest |