docs: Update Ubuntu Install guide (#6818) #1197
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: Docker | |
on: | |
push: | |
branches: | |
- main | |
env: | |
php-version: '8.1' | |
node-version: 18 | |
concurrency: | |
group: Docker ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docker-run: | |
runs-on: ubuntu-latest | |
name: Docker build developpment | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Docker meta | |
id: docker_meta | |
uses: crazy-max/ghaction-docker-meta@v4 | |
with: | |
images: ghcr.io/monicahq/monica | |
tag-sha: true | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.CR_USER }} | |
password: ${{ secrets.CR_PAT }} | |
# Composer | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer files | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ env.php-version }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer-${{ env.php-version }}-${{ hashFiles('**/composer.lock') }} | |
${{ runner.os }}-composer-${{ env.php-version }} | |
${{ runner.os }}-composer- | |
# Yarn | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.node-version }} | |
- name: Get yarn cache directory path | |
id: yarn-cache | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Cache yarn files | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
${{ runner.os }}-yarn- | |
# Install | |
- name: Install | |
run: scripts/docker/build.sh --skip-build $GITHUB_SHA | |
# Build docker | |
- name: Docker build | |
id: docker_build | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
file: scripts/docker/Dockerfile | |
context: . | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |