feat: restart work on lastgram-next #51
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 deploy | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
name: "Build image" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Get package version | |
id: version | |
uses: martinbeentjes/npm-get-version-action@main | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download translations | |
uses: crowdin/github-action@v1 | |
with: | |
upload_sources: false | |
upload_translations: false | |
download_translations: true | |
create_pull_request: false | |
push_translations: false | |
env: | |
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | |
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} | |
CROWDIN_BASE_URL: ${{ secrets.CROWDIN_BASE_URL }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
"ghcr.io/${{ github.repository }}:latest" | |
"ghcr.io/${{ github.repository }}:${{ steps.version.outputs.current-version}}-${{ github.run_id }}" | |
labels: "version=${{ steps.version.outputs.current-version}}-${{ github.run_id }}" | |
deploy-stage: | |
name: "Staging deploy" | |
runs-on: ubuntu-latest | |
needs: build | |
environment: staging | |
steps: | |
- name: Deploy Stage | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: ${{ secrets.DEPLOY_WEBHOOK_URL }} | |
method: 'POST' | |
timeout: 30000 | |
crowdin: | |
name: Upload sources to Crowdin | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Crowdin push | |
uses: crowdin/github-action@v1 | |
with: | |
upload_sources: true | |
upload_translations: false | |
download_translations: false | |
env: | |
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | |
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} | |
CROWDIN_BASE_URL: ${{ secrets.CROWDIN_BASE_URL }} | |