Skip to content

Commit

Permalink
💚 ci(env): upq
Browse files Browse the repository at this point in the history
  • Loading branch information
angelespejo committed Jan 20, 2025
1 parent 24814aa commit da2f266
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 60 deletions.
117 changes: 64 additions & 53 deletions .github/workflows/2023-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILD, PUSH, AND DEPLOY
#############################################################################

name: 🌐🐦⚡️ Build & Push Docker Image
name: 2023 - 🌐🐦⚡️ Build & Push Docker Image

on:
pull_request:
Expand All @@ -15,92 +15,103 @@ concurrency: ${{ github.workflow }}-refs/heads/2023
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
REPO_TEST: ${{ github.repository }}:2023-test
REPO_LATEST: ${{ github.repository }}:2023-latest
CONTEXT_DOCKER: packages/web/.
ID: 2023
WEB_DIR: packages/web

# #############################################################################

###############################################################################
# JOBS
# #############################################################################
###############################################################################

jobs:
build-and-push:
runs-on: ubuntu-latest

###########################################################################
# STEPS
###########################################################################

deploy:
runs-on: 'ubuntu-latest'
steps:

#########################################################################
# SETUP
# INIT
#########################################################################

- name: ☑️ Checkout code
uses: actions/checkout@v2
- name: ⬇️🛑 Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️🛎 Checkout
uses: actions/checkout@v4
- name: ⬇️🥡 Install pnpm
uses: pnpm/action-setup@v4
- name: ⬇️🟢 Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

# - name: ⬇️📦 Install dependencies
# run: pnpm install --no-frozen-lockfile

- name: ☑️ Set up QEMU
- name: ⬇️🐳 Set up QEMU
uses: docker/setup-qemu-action@v1

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

- name: 🏷 Get version from package.json
id: package_version
run: |
TAG_NAME=$(cat packages/web/package.json | jq -r '.version')
echo "TAG_NAME=2023-$TAG_NAME" >> $GITHUB_ENV
#########################################################################
# LOGIN TO DOCKER
#########################################################################

- name: 🐳 Login to Docker Hub
- name: 🐳☑️ Login to Docker Hub
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

#########################################################################
# TEST DOCKER IMAGE
#########################################################################

- name: 🐳📝 (TEST) Build and load to test
uses: docker/build-push-action@v4
- name: 🐳☑️ Login to GitHub Container Registry
uses: docker/login-action@v1
with:
context: ${{ env.CONTEXT_DOCKER }}
load: true
# platforms: linux/amd64,linux/arm64
tags: ${{ env.REPO_TEST }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 🐳📝 (TEST) execute test
- name: 📦📄 Get package.json data
id: pkg
run: |
docker run --rm ${{ env.REPO_TEST }}
echo "name=$(jq -r '.extra.productName' ./package.json)" >> $GITHUB_OUTPUT
echo "description=$(jq -r '.description' ./package.json)" >> $GITHUB_OUTPUT
echo "homepage=$(jq -r '.homepage' ./package.json)" >> $GITHUB_OUTPUT
echo "version=$(jq -r '.version' ${{env.WEB_DIR}}/package.json)" >> $GITHUB_OUTPUT
#########################################################################
# BUILD & PUSH
# PUSH IMAGE
#########################################################################

- name: 🐳🚀 Build and push image
id: docker_build
uses: docker/build-push-action@v4
with:
context: ${{ env.CONTEXT_DOCKER }}
context: ${{env.WEB_DIR}}
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ github.repository }}:${{ env.TAG_NAME }}
${{ env.REPO_LATEST }}
${{ github.repository }}:${{ env.ID }}-${{ steps.pkg.outputs.version }}
ghcr.io/${{ github.repository }}:${{ env.ID }}-latest
- name: 📝 Update Docker Hub metadata
uses: docker/metadata-action@v3
#########################################################################
# UPDATE DOCKERHUB DATA
#########################################################################

- name: 🐳📝 Update Docker Hub repo description
uses: peter-evans/dockerhub-description@v3
with:
images: ${{ github.repository }}:${{ env.TAG_NAME }},${{ env.REPO_LATEST }}
# @see https://github.com/peter-evans/dockerhub-description
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
repository: ${{ github.repository }}
short-description: ${{ steps.pkg.outputs.description }}
readme-filepath: ./README.md

- name: Add release
uses: ncipollo/release-action@v1
with:
tag: "${{ env.ID }}-${{ steps.pkg.outputs.version }}"
draft: false
prerelease: false
allowUpdates: true
body: |
PigeonPosse Web [${{ env.ID }}] v.${{ steps.pkg.outputs.version }}
omitBodyDuringUpdate: true

env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_ACCESS_TOKEN }}

###############################################################################
4 changes: 2 additions & 2 deletions .github/workflows/2023-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILD, PUSH, AND DEPLOY
#############################################################################

name: 🌐🐦⚡️ Release
name: 2023 - 🌐🐦⚡️ Release

on:
pull_request:
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
if: steps.updated.outputs.core_version != ''
uses: benc-uk/workflow-dispatch@v1
with:
workflow: docker.yml
workflow: 2023-docker.yml
continue-on-error: true

###############################################################################
6 changes: 6 additions & 0 deletions packages/web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
### Changelog

## 0.0.25

### Patch Changes

- up env

## 0.0.24

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ Official web for _PigeonPosse_ collective. ✨
## 🔑 Installation

```bash
npm install @pigeonposse-web/2023
npm install @pigeonposse/web-2023
# or
pnpm install @pigeonposse-web/2023
pnpm install @pigeonposse/web-2023
```

## ⚙️ Usage

## 🟢 Node

```bash
pnpm install @pigeonposse-web/2023
pnpm install @pigeonposse/web-2023
pnpm exec pp-web
```

Expand Down
4 changes: 2 additions & 2 deletions packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pigeonposse/web-2023",
"version": "0.0.24",
"version": "0.0.25",
"description": "Official web for PigeonPosse collective (2023 version). ✨",
"keywords": [
"pigeonposse",
Expand All @@ -19,7 +19,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/pigeonposse/pigeon-web"
"url": "https://github.com/pigeonposse/pigeon-web/tree/2023"
},
"funding": {
"type": "individual",
Expand Down

0 comments on commit da2f266

Please sign in to comment.