forked from badtuxx/giropops-senhas
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adicionar etapas de implantação packages para produção, staging…
… e desenvolvimento
- Loading branch information
1 parent
422845d
commit 01eccd1
Showing
3 changed files
with
151 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Melange, APKO e GitHub Container Registry em Desenvolvimento | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
build: | ||
name: Melange, APKO e GitHub Container Registry | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
# Checkout do código | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
# Configurar Docker Buildx | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# Instalar Melange | ||
- name: Install Melange | ||
run: | | ||
wget https://github.com/chainguard-dev/melange/releases/download/v0.11.2/melange_0.11.2_linux_386.tar.gz | ||
tar -xzf melange_0.11.2_linux_386.tar.gz | ||
cd melange_0.11.2_linux_386 | ||
sudo mv melange /usr/local/bin/ | ||
melange version | ||
# Instalar APKO | ||
- name: Install APKO | ||
run: | | ||
wget https://github.com/chainguard-dev/apko/releases/download/v0.14.7/apko_0.14.7_linux_386.tar.gz | ||
tar -xzf apko_0.14.7_linux_386.tar.gz | ||
cd apko_0.14.7_linux_386 | ||
sudo mv apko /usr/local/bin/ | ||
apko version | ||
# Gerar chaves com Melange | ||
- name: Generate keys with Melange | ||
run: | | ||
cd chainguard/environments/dev | ||
melange keygen | ||
# Construir pacotes com Melange | ||
- name: Build packages with Melange | ||
run: | | ||
cd chainguard/environments/dev | ||
melange build melange-prod.yaml --runner docker --signing-key melange.rsa --arch amd64 | ||
# Construir imagem de container com APKO | ||
- name: Build container image with APKO | ||
run: | | ||
cd chainguard/environments/dev | ||
apko build apko-prod.yaml senhas senhas-prod.tar -k melange.rsa.pub --arch amd64 | ||
# Log in no GitHub Container Registry | ||
- name: Log in to GitHub Container Registry | ||
env: | ||
CR_PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
run: echo $CR_PAT | docker login ghcr.io -u nataliagranato --password-stdin | ||
|
||
# Load da imagem de container e push para o GitHub Container Registry | ||
- name: Load Docker image | ||
run: | | ||
cd chainguard/environments/dev | ||
docker load < senhas-prod.tar | ||
docker images | ||
docker tag senhas:latest-amd64 ghcr.io/nataliagranato/senhas-dev:$(date +%s) | ||
docker push ghcr.io/nataliagranato/senhas-dev:$(date +%s) |
2 changes: 1 addition & 1 deletion
2
.github/workflows/environments.yml → .github/workflows/package-prd.yml
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Melange, APKO e GitHub Container Registry em Staging | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
build: | ||
name: Melange, APKO e GitHub Container Registry | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
# Checkout do código | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
# Configurar Docker Buildx | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# Instalar Melange | ||
- name: Install Melange | ||
run: | | ||
wget https://github.com/chainguard-dev/melange/releases/download/v0.11.2/melange_0.11.2_linux_386.tar.gz | ||
tar -xzf melange_0.11.2_linux_386.tar.gz | ||
cd melange_0.11.2_linux_386 | ||
sudo mv melange /usr/local/bin/ | ||
melange version | ||
# Instalar APKO | ||
- name: Install APKO | ||
run: | | ||
wget https://github.com/chainguard-dev/apko/releases/download/v0.14.7/apko_0.14.7_linux_386.tar.gz | ||
tar -xzf apko_0.14.7_linux_386.tar.gz | ||
cd apko_0.14.7_linux_386 | ||
sudo mv apko /usr/local/bin/ | ||
apko version | ||
# Gerar chaves com Melange | ||
- name: Generate keys with Melange | ||
run: | | ||
cd chainguard/environments/stg | ||
melange keygen | ||
# Construir pacotes com Melange | ||
- name: Build packages with Melange | ||
run: | | ||
cd chainguard/environments/stg | ||
melange build melange-prod.yaml --runner docker --signing-key melange.rsa --arch amd64 | ||
# Construir imagem de container com APKO | ||
- name: Build container image with APKO | ||
run: | | ||
cd chainguard/environments/stg | ||
apko build apko-prod.yaml senhas senhas-prod.tar -k melange.rsa.pub --arch amd64 | ||
# Log in no GitHub Container Registry | ||
- name: Log in to GitHub Container Registry | ||
env: | ||
CR_PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
run: echo $CR_PAT | docker login ghcr.io -u nataliagranato --password-stdin | ||
|
||
# Load da imagem de container e push para o GitHub Container Registry | ||
- name: Load Docker image | ||
run: | | ||
cd chainguard/environments/stg | ||
docker load < senhas-prod.tar | ||
docker images | ||
docker tag senhas:latest-amd64 ghcr.io/nataliagranato/senhas-stg:$(date +%s) | ||
docker push ghcr.io/nataliagranato/senhas-stg:$(date +%s) |