Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): bump rubocop from 1.30.1 to 1.31.2 #502

Closed
wants to merge 152 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
4045963
feat: squash commits before 2020.11.09 (#253)
mashirozx Nov 9, 2020
cbbde1b
docs: add translation server and markdown image proxy configuration
mashirozx Nov 9, 2020
0b0ff5e
chore: add Github workflow for master branch
mashirozx Nov 13, 2020
3a32848
feat: enhance join reason display in admin UI
mashirozx Dec 2, 2020
ac15e98
feat: make character limit configurable
mashirozx Dec 5, 2020
64b01b5
feat: make media file size limit configurable
mashirozx Dec 5, 2020
6624f28
feat: add captcha to registration form
mashirozx Dec 7, 2020
050e7ec
fixup: change rucaptcha redis cache storage
mashirozx Apr 7, 2021
68a4221
fix: update media model handlers in quotation
mashirozx Nov 19, 2020
6465d31
chore: add gem version lock
mashirozx Dec 10, 2020
dbf5226
fix: remove RTL in quote indicator
mashirozx Dec 16, 2020
6c3ae1a
feat: RSSHub translation endpoint support
mashirozx Dec 17, 2020
7b76f65
fix: remove unused theme fonts
mashirozx Dec 18, 2020
67640c7
feat: snowfall effect
mashirozx Dec 18, 2020
ccb276d
feat: insert remote media with short code
mashirozx Dec 19, 2020
990c104
fix: status public page crash caused by missing remote media opengraph
mashirozx Dec 21, 2020
eea63b6
feat: exclude bot statuses from LTL
mashirozx Dec 21, 2020
4e99803
fix: remove bot statuses in React from LTL (TODO: remove from Redux)
mashirozx Dec 29, 2020
3eff8a0
feat: exclude bots statuses from Elasticsearch
mashirozx Dec 22, 2020
d96c11e
feat: add password option to account create CLI
mashirozx Dec 22, 2020
54da764
feat: Media Sudoku (media attachments limit 4 -> 9)
mashirozx Dec 15, 2020
ada128d
fix: fixup neon-city theme
mashirozx Dec 29, 2020
9e08176
feat: add user custom css option
mashirozx Dec 23, 2020
50024d3
fix: expand video on public page for quote
noellabo Dec 30, 2020
e6b25c8
feat: add RaRuRe theme
mashirozx Jan 4, 2021
e0dfe5f
fix: support remote code block highlight (rouge)
mashirozx Jan 4, 2021
afa6a40
fix: change quote video height to 1/1
mashirozx Jan 6, 2021
fc136f8
feat: disable feed for bot account
mashirozx Jan 6, 2021
4fae98d
fix: fixup video modal handler in quotation
noellabo Jan 3, 2021
50d3c90
feat: add quote and bookmark button in PiP
noellabo Dec 27, 2020
be8b059
feat: move bookmark to action bar
noellabo Jan 13, 2020
75f741d
fix: move local only icon to header
mashirozx Jan 6, 2021
b39a3de
feat: add custom full width iframe support
mashirozx Jan 6, 2021
23d1fcc
fix: add secondary-text-color output
mashirozx Jan 8, 2021
f330643
feat: display external link preview card in quotation
mashirozx Jan 8, 2021
96e47db
fix: rich-content iframe button style
mashirozx Jan 9, 2021
e7e9723
fix: change unlisted quote display
mashirozx Jan 10, 2021
b14570d
feat: add iframe fullscreen button (#257)
mashirozx Jan 10, 2021
9580a35
ci: switch workflow to main branch
mashirozx Jan 28, 2021
67927e0
fix: accounts controller sytax mistake & bump sidekiq-statistic
mashirozx Mar 13, 2021
a52ca55
fix: normalize i18n (bundle)
mashirozx Mar 19, 2021
49c5852
build: add rails host config to development environment
mashirozx Mar 29, 2021
5466b08
build: switch fontawesome to github repo
mashirozx Apr 8, 2021
7c5f53b
feat: revert auto follow feature for admins
mashirozx Apr 25, 2021
a91fec1
fix: [WIP] rspec
mashirozx Apr 25, 2021
536e12f
fix: revert local account check
mashirozx Apr 25, 2021
91ac959
build: remove ruby and bundle version lock
mashirozx Apr 25, 2021
57ed222
fix: add auth page styles in neon-city
mashirozx Apr 27, 2021
0ecc998
build: bump rouge version
mashirozx May 11, 2021
e9f8eeb
fix: change drag upload image limit 4 => 9
mashirozx May 17, 2021
d8a127d
build(deps): bump rouge
mashirozx Aug 2, 2021
8be8560
ci: disable i18n check
mashirozx Aug 2, 2021
e2cae7b
fix: quote account click in detailed status
mashirozx Aug 6, 2021
b54690d
ci: upgrade docker/build-push-action@v2
mashirozx Sep 2, 2021
03e8eb1
perf: bump api rate limit 300=>600
mashirozx Sep 29, 2021
22b848b
perf: add bot check box warning text
mashirozx Oct 6, 2021
5344e8a
feat: add Prometheus exporter metrics
mashirozx Oct 6, 2021
7670bd4
ci: upgrade workflows
mashirozx Oct 26, 2021
fc676da
fix: disable emoji-mart autoFocus
mashirozx Oct 26, 2021
8e77b8c
feat: add dev image and workflow
mashirozx Oct 27, 2021
273e180
feat: add category name to custom emoji search keywords list
mashirozx Oct 27, 2021
e04063b
feat: add analytics support (plausible & matomo)
mashirozx Nov 3, 2021
f49b2f4
fix: dupilcated MAX_TOOT_LENGTH & enable captcha condition
mashirozx Nov 5, 2021
611bf20
ci: rm tootsuite/mastodon workflow
mashirozx Nov 15, 2021
a73d9ab
feat: add theme beebear
mashirozx Nov 17, 2021
1a1542e
build(deps): bump rouge version, bump ruby & bundler version
mashirozx Nov 22, 2021
b6e27ab
fix: quote account jumping
mashirozx Nov 22, 2021
37166a6
feat: add OAuth2 providers (#260)
mashirozx Nov 26, 2021
64e11e0
fix: rucaptcha cache store
mashirozx Nov 29, 2021
e97f37d
fix: login provider button display
mashirozx Nov 29, 2021
a6082b1
fix: auto follow translation (zh_CN)
mashirozx Nov 29, 2021
5ab99eb
perf: add bootstrap events for auth providers
mashirozx Nov 29, 2021
337e6ff
feat: add environment variables to control custom emoji size limits
ClearlyClaire Apr 25, 2021
d9c321e
fix: auth provider conf example
mashirozx Nov 29, 2021
4628277
perf: search more emojis!
mashirozx Nov 29, 2021
f720f00
feat: use sans font for chinese
mashirozx Nov 29, 2021
3a7b893
fix: register form in about page
mashirozx Dec 2, 2021
d5b3f4b
fix: captcha input border
mashirozx Dec 2, 2021
3b6f46a
fix: oauth provider email logic
mashirozx Dec 3, 2021
83656a6
docs: update configuration sample
mashirozx Dec 20, 2021
43e0f57
perf: add password reset tips
mashirozx Dec 21, 2021
ccb9b31
perf: enhance neon city
mashirozx Dec 23, 2021
5efc7bb
perf: move serief font switch logic to body class helper
mashirozx Dec 23, 2021
41a072f
fix: revert incorrect gitlab scopes
mashirozx Dec 27, 2021
799a27f
perf: change local timeline bot filter logic
mashirozx Dec 29, 2021
f00ca7d
perf: authorized new users shall not be required to fill in profile
mashirozx Dec 29, 2021
948595f
perf: initial profile for all new user
mashirozx Dec 30, 2021
f9eb314
fix: social login button display
mashirozx Jan 25, 2022
b217d53
fix: invalid scope in process_mentions_service
mashirozx Jan 25, 2022
e7d0989
fix: local only and content type passing to composer in edit mode
mashirozx Feb 10, 2022
281d66b
fix(temp): missing components props (waiting for upstream fixup)
mashirozx Feb 10, 2022
6ed3fa6
Revert "Chore: Disable menu items for editing statuses in web UI (#17…
mashirozx Feb 11, 2022
aa91c59
feat: add account alias and migration CLI (#261)
mashirozx Feb 14, 2022
c08ed00
fix: gemlock file
mashirozx Feb 22, 2022
901afe9
fix: disable local only button in edit mode
mashirozx Feb 22, 2022
4555bc1
fix: db schema
mashirozx Mar 5, 2022
0fd7c27
fix: handling remote media short code
mashirozx Mar 15, 2022
346394f
build(dev-container): use elasticsearch-cnplugin image
mashirozx Mar 19, 2022
b1070ac
build(dev-container): disable elasticsearch stack
mashirozx Mar 19, 2022
a06770f
fix: media sudoku
mashirozx Mar 19, 2022
cbd8ebf
ci(dev-container): change workflow
mashirozx Mar 19, 2022
020f5e3
build(dev-container): use Chinese mirror
mashirozx Mar 28, 2022
19bf9df
build(deps): rebuild Gemfile.lock
mashirozx Mar 31, 2022
83e7130
fix(markdown): refactor markdown formatter
mashirozx Apr 1, 2022
09868bc
fix(quote): refactor quotation formatter
mashirozx Apr 1, 2022
0631b8b
fix: markdown escape
mashirozx Apr 1, 2022
da91336
build(deps): bump kramdown from 2.3.0 to 2.3.2 (#270)
dependabot[bot] Apr 3, 2022
009214e
build(deps): bump rouge from 3.26.1 to 3.28.0 (#273)
dependabot[bot] Apr 3, 2022
179fb6c
fix: skip URL formatting in markdown type
mashirozx Apr 17, 2022
ac87a2b
ci(drone): add arm64 architecture to workflow
mashirozx May 19, 2022
0fb36f4
ci(gh-action): add Qemu but skip arm64 build
mashirozx May 20, 2022
3259b5d
ci(gh-action): add ci skip [skip ci]
mashirozx May 21, 2022
72da4e5
ci(drone): fix line break
mashirozx May 21, 2022
4eda9bf
build: bump ruby version
mashirozx May 27, 2022
97e83f4
fix: handle defaultMessage conflict
mashirozx May 27, 2022
1832776
fix: db schema
mashirozx May 27, 2022
27c4186
fix: remove deprecated `not_bots`
mashirozx May 27, 2022
da6d47f
build(deps): bump kramdown from 2.3.2 to 2.4.0
dependabot[bot] May 28, 2022
3e8fd8f
fix(markdown): bypass the `<p>` wrapper
mashirozx May 29, 2022
c52e1a4
fix(markdown): also convert url into a tag in markdown mode
mashirozx May 30, 2022
19287a7
fixup: remove rails logger from formatter
mashirozx May 31, 2022
c0b31c7
ci(drone): ignore email error
mashirozx May 31, 2022
1e2207a
perf(markdown): enhance link converter and image coonverter
mashirozx Jun 2, 2022
0871de5
docs: update configuration sample
mashirozx Jun 2, 2022
d4b5315
refactor(markdown): refactor markdown formatter
mashirozx Jun 2, 2022
ab7460a
fix(quote): add quote fallback context
mashirozx Jun 3, 2022
819c363
perf(quote): quote status content style
mashirozx Jun 7, 2022
f23c2c7
feat(icon-pack): add icon pack support
mashirozx Jun 7, 2022
9b56df2
fix(oauth2): add password and other necessary fields to enable passwo…
mashirozx Jun 7, 2022
a510e54
perf(redis): make `:redis` method public
mashirozx Jun 7, 2022
9206c74
feat(oauth2): send password to oauth login user
mashirozx Jun 7, 2022
d1387b0
feat(oauth2): also set locale column
mashirozx Jun 8, 2022
4f91a10
feat: trends without review
Gargron Apr 6, 2022
7fc2d24
feat(dev): allow send email in dev environment
mashirozx Jun 9, 2022
4f5a7f6
fix(quote): `quote` may not exists in `#<StatusEdit>`
mashirozx Jun 9, 2022
b47bb75
feat: allow admin to customize invite request hints
mashirozx Jun 9, 2022
216b8ba
ci(gh-action): add cross platform compile workflow
mashirozx Jun 18, 2022
744aee6
ci(gh-action): enhance image build process
mashirozx Jun 18, 2022
e7044e7
ci(drone): enhance drone workflow
mashirozx Jun 18, 2022
b92c6bc
docs: update readme (#452)
mashirozx Jun 18, 2022
0e4ddcf
feat: restore the classic blue theme
mashirozx Jul 3, 2022
75d6567
feat: localize iconfont and fuck iconfont.cn
mashirozx Jul 3, 2022
df2ed11
feat(dev-docker): add docker dev configuration
mashirozx Jul 7, 2022
04d503b
build(docker): change es version
mashirozx Jul 7, 2022
1206aee
feat(oauth2): add Gitee Oauth2 support
mashirozx Jul 7, 2022
faa7a65
feat(oauth2): add azure strategy
mashirozx Jul 8, 2022
ee5cfa6
feat(oauth2): add oauth 2 privacy notice
mashirozx Jul 8, 2022
3a59079
perf: order about page
mashirozx Jul 8, 2022
d98c69b
fix: flex-start
mashirozx Jul 8, 2022
f3d1ed2
fix: restore the original theme-color
mashirozx Jul 11, 2022
2d5055e
ci(gh-actions): build image for releases
mashirozx Jul 11, 2022
1b32855
feat: add quote and bookmark button in PiP
dependabot[bot] Jul 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
RUN gem install foreman

# [Optional] Uncomment this line to install global node packages.
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g yarn" 2>&1
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g yarn tyarn" 2>&1
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"forwardPorts": [3000, 4000],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bundle install --path vendor/bundle && yarn install && ./bin/rails db:setup",
"postCreateCommand": "bundle config mirror.https://rubygems.org https://gems.ruby-china.com && bundle install --path vendor/bundle && yarn install && ./bin/rails db:setup",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
Expand Down
35 changes: 18 additions & 17 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
DB_USER: postgres
DB_PASS: postgres
DB_PORT: '5432'
ES_ENABLED: 'true'
ES_ENABLED: 'false'
ES_HOST: es
ES_PORT: '9200'
# Overrides default command so things don't shut down after the process ends.
Expand Down Expand Up @@ -55,22 +55,23 @@ services:
networks:
- internal_network

es:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
restart: unless-stopped
environment:
ES_JAVA_OPTS: -Xms512m -Xmx512m
cluster.name: es-mastodon
discovery.type: single-node
bootstrap.memory_lock: 'true'
volumes:
- es-data:/usr/share/elasticsearch/data
networks:
- internal_network
ulimits:
memlock:
soft: -1
hard: -1
# es:
# # image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
# image: mashirozx/elasticsearch-cnplugin:7.16.1
# restart: unless-stopped
# environment:
# ES_JAVA_OPTS: -Xms512m -Xmx512m
# cluster.name: es-mastodon
# discovery.type: single-node
# bootstrap.memory_lock: 'true'
# volumes:
# - es-data:/usr/share/elasticsearch/data
# networks:
# - internal_network
# ulimits:
# memlock:
# soft: -1
# hard: -1

volumes:
postgres-data:
Expand Down
107 changes: 107 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
kind: pipeline
name: arm64

platform:
os: linux
arch: arm64

steps:
- name: email notification on start
image: mashirozx/drone-email:latest-arm64
failure: ignore
settings:
host:
from_secret: smtp_host
port:
from_secret: smtp_port
username:
from_secret: smtp_username
password:
from_secret: smtp_password
from.address:
from_secret: smtp_from_address
from.name:
from_secret: smtp_from_name
recipients:
from_secret: smtp_recipients
subject: >
{{repo.owner}}/{{repo.name}}:${DRONE_COMMIT_BRANCH} arm64 build #${DRONE_BUILD_NUMBER} start
body: >
${DRONE_COMMIT_MESSAGE}<br /><br />
Git repo: {{repo.owner}}/{{repo.name}}<br />
Git branch: ${DRONE_COMMIT_BRANCH}<br />
Git hash: <a href="${DRONE_COMMIT_LINK}" target="_blank">${DRONE_COMMIT_SHA}</a><br />
Git author: ${DRONE_COMMIT_AUTHOR_NAME} (${DRONE_COMMIT_AUTHOR})<br />
<br />View CI detail: {{build.link}}
<br /><br />
Drone CI ${DRONE_SYSTEM_VERSION}
when:
branch:
- main
event:
- push
- tag

- name: build arm64 image
image: plugins/docker
settings:
repo:
from_secret: docker_repo
tags:
- latest-arm64
- sha-${DRONE_COMMIT_SHA:0:8}-arm64
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: Dockerfile.slim
squash: true
when:
branch:
- main
event:
- push

- name: email notification on complete
image: mashirozx/drone-email:latest-arm64
failure: ignore
settings:
host:
from_secret: smtp_host
port:
from_secret: smtp_port
username:
from_secret: smtp_username
password:
from_secret: smtp_password
from.address:
from_secret: smtp_from_address
from.name:
from_secret: smtp_from_name
recipients:
from_secret: smtp_recipients
subject: >
{{#success build.status}}
{{repo.owner}}/{{repo.name}}:${DRONE_COMMIT_BRANCH} arm64 build #${DRONE_BUILD_NUMBER} succeeded
{{else}}
{{repo.owner}}/{{repo.name}}:${DRONE_COMMIT_BRANCH} arm64 build #${DRONE_BUILD_NUMBER} failed
{{/success}}
body: >
${DRONE_COMMIT_MESSAGE}<br /><br />
Git repo: {{repo.owner}}/{{repo.name}}<br />
Git branch: ${DRONE_COMMIT_BRANCH}<br />
Git hash: <a href="${DRONE_COMMIT_LINK}" target="_blank">${DRONE_COMMIT_SHA}</a><br />
Git author: ${DRONE_COMMIT_AUTHOR_NAME} (${DRONE_COMMIT_AUTHOR})<br />
<br />View CI detail: {{build.link}}
<br /><br />
Drone CI ${DRONE_SYSTEM_VERSION}
when:
branch:
- main
event:
- push
- tag
status:
- success
- failure
87 changes: 87 additions & 0 deletions .env.production.sample
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,90 @@ S3_ALIAS_HOST=files.example.com
# -----------------------
IP_RETENTION_PERIOD=31556952
SESSION_RETENTION_PERIOD=31556952

##
## Follow to the end of file is the configuration for mashirozx's fork
##
# Git display repo, please keep this to let more people reach this repo
GITHUB_REPOSITORY=mashirozx/mastodon

## Here are two kinds of Google translate free API
# High performance translation server (https://github.com/mashirozx/google-translate-server)
# NB: Google forbidden requests of this endpoint from some VPS IDCs
TRANSLATION_SERVER_HOST=http://translate:30031

# RSSHub based translate API (https://github.com/mashirozx/RSSHub)
#TRANSLATION_SERVER_TYPE=rsshub
#TRANSLATION_SERVER_HOST=http://rsshub.example.com

# Markdown image proxy, if not set, will not display image preview in markdown mode
IMAGE_PROXY_HOST=https://img-proxy.mashiro.top
IMAGE_PROXY_PATH=https://img-proxy.mashiro.top

# Max toot character limit
MAX_TOOT_CHARS=500

# Max media file size (megabytes)
IMAGE_LIMIT=10
VIDEO_LIMIT=40
AVATAR_LIMIT=2
HEADER_LIMIT=2
# Emoji size (kilobytes)
MAX_EMOJI_SIZE=51200
MAX_REMOTE_EMOJI_SIZE=204800

# Maximum custom emoji file sizes
# If undefined or smaller than MAX_EMOJI_SIZE, the value
# of MAX_EMOJI_SIZE will be used for MAX_REMOTE_EMOJI_SIZE
# Units are in bytes
MAX_EMOJI_SIZE=51200
MAX_REMOTE_EMOJI_SIZE=204800

# Allow insert remote media with url on toots
# eg:
# IMAGE: [https://example.com/example.png]
# VIDEO: [https://example.com/example.mp4/mp3]
ALLOW_REMOTE_MEDIA_TAG=true

# Analytics services
PLAUSIBLE_ANALYTICS_HOST=analytics.moezx.cc
# PLAUSIBLE_ANALYTICS_SITE_DOMAIN=hello.2heng.xin
MATOMO_ANALYTICS_HOST=analytics.2heng.xin
MATOMO_ANALYTICS_SITE_ID=3

# Third party OAuth providers
# Force skip invite request when using an OAuth provider
AUTO_REGISTRATION_WITH_AUTH_PROVIDERS=true

# When auth providers were set, the about page layout should better to be reordered
REORDER_ABOUT_PAGE=true

# Callback url: https://littlefo.rest/auth/auth/github/callback
# Scope: user.info
GITHUB_OAUTH2_ENABLED=true
GITHUB_OAUTH2_KEY=your_key
GITHUB_OAUTH2_SECRET=your_secret

# Callback url: https://littlefo.rest/auth/auth/gitlab/callback
# Scope: read_user
GITLAB_OAUTH2_ENABLED=true
GITLAB_OAUTH2_KEY=your_key
GITLAB_OAUTH2_SECRET=your_secret

# Callback url: https://littlefo.rest/auth/auth/gitee/callback
# Scope: user_info emails
GITEE_OAUTH2_ENABLED=true
GITEE_OAUTH2_KEY=your_key
GITEE_OAUTH2_SECRET=your_secret

# Azure Oauth 2 Authentication
# https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app
# Callback url: https://littlefo.rest/auth/auth/azure_oauth2/callback
# Scope: email openid profile
AZURE_OAUTH2_ENABLED=true
# client id
AZURE_OAUTH2_KEY=your_key
# not the Secret ID but the value!
AZURE_OAUTH2_SECRET=your_secret
# optional tenant id if using a multi-tenant azure account: http://msdn.microsoft.com/en-us/library/azure/dn645542.aspx
AZURE_OAUTH2_TENANT_ID=your_tenant_id
6 changes: 3 additions & 3 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
workflow_dispatch:
push:
branches:
- 'main'
tags:
- '*'
- 'main-disable'
# tags:
# - '*'
pull_request:
paths:
- .github/workflows/build-image.yml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Check i18n

on:
push:
branches: [main]
branches: [main-disable]
pull_request:
branches: [main]
branches: [main-disable]

env:
RAILS_ENV: test
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/docker-build-amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build amd64 Image

on:
push:
branches:
- main

jobs:
docker-build:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.commits.*.message, '[skip ci]') && !contains(github.event.commits.*.message, '[ci skip]') }}

steps:
- name: 🔍 Checkout code
uses: actions/checkout@v2

- name: 🦄 Set up Qemu for Docker
uses: docker/setup-qemu-action@v1

- name: 🏗️ Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: 🔑 Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: 🎃 Setup outputs
id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"

- name: 👻 Setup metadata
uses: docker/metadata-action@v3
id: meta
with:
images: mashirozx/mastodon
flavor: |
latest=auto
tags: |
type=edge,branch=main
type=match,pattern=v(.*),group=0
type=ref,event=pr

- name: ⚓ Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile.slim
pull: true
push: true
platforms: linux/amd64
cache-from: type=registry,ref=mashirozx/mastodon:latest
cache-to: type=inline
tags: |
mashirozx/mastodon:latest-amd64
mashirozx/mastodon:sha-${{steps.vars.outputs.sha_short}}-amd64
44 changes: 44 additions & 0 deletions .github/workflows/docker-build-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build Dev Image

on:
push:
branches:
- main

jobs:
docker-build:
runs-on: ubuntu-latest

steps:
- name: 🔍 Checkout code
uses: actions/checkout@v2

- name: 🏗️ Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: 🔑 Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: 🎃 Set up outputs
id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"

- name: ⚓ Build and push
uses: docker/build-push-action@v2
with:
context: .
file: .devcontainer/Dockerfile
pull: true
push: true
build-args: |
VARIANT=3.0-bullseye
NODE_VERSION=14
cache-from: type=registry,ref=mashirozx/mastodon:dev
cache-to: type=inline
tags: |
mashirozx/mastodon:dev
mashirozx/mastodon:dev-${{steps.vars.outputs.sha_short}}
Loading