Update AppServiceProvider.php #5
This file contains hidden or 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: Image Build and Push | |
on: | |
push: | |
branches: | |
- '*' | |
env: | |
IMAGE_NAME: paste | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/composer-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
- name: Install composer dependencies | |
uses: php-actions/composer@v6 | |
with: | |
php_version: "8.2" | |
args: --profile --ignore-platform-reqs | |
dev: no | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 17 | |
cache: 'npm' | |
cache-dependency-path: package-lock.json | |
- name: Install node dependencies | |
run: | | |
npm install | |
npm run build | |
- name: Build image | |
run: docker build . --file docker/app/Dockerfile --tag $IMAGE_NAME | |
- name: Push image | |
run: | | |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
COMMIT=$(echo "${{ github.sha }}") | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
[ "$VERSION" == "main" ] && VERSION=latest | |
echo IMAGE_ID=$IMAGE_ID | |
echo VERSION=$VERSION | |
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION | |
docker tag $IMAGE_NAME $IMAGE_ID:$COMMIT | |
docker push $IMAGE_ID:$VERSION | |
docker push $IMAGE_ID:$COMMIT |