Bump docker/login-action from 2 to 3 #40
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 | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
archive: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- type: aosp_aarch64 | |
link: https://dl.google.com/developers/android/tm/images/gsi/aosp_arm64-exp-TP1A.220624.014-8819323-996da050.zip | |
- type: aosp_x86_64 | |
link: https://dl.google.com/developers/android/tm/images/gsi/aosp_x86_64-exp-TP1A.220624.014-8819323-045fbd68.zip | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Archive | |
run: | | |
curl -fsSLo ${{ matrix.type }}.zip ${{ matrix.link }} | |
unzip ${{ matrix.type }}.zip | |
mkdir sysroot | |
sudo mount -o loop,ro system.img sysroot | |
cd sysroot | |
sudo ../libexec/ls-files | sudo tar -cvzf ../${{ matrix.type }}.tar.gz -T- | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.type }} | |
path: ${{ matrix.type }}.tar.gz | |
if-no-files-found: error | |
build: | |
needs: [archive] | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: aosp_aarch64 | |
- name: Download Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: aosp_x86_64 | |
- name: Docker Metadata | |
id: docker-metadata | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=edge | |
type=ref,event=branch | |
type=ref,event=pr | |
type=ref,event=tag | |
type=schedule | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
tags: ${{ steps.docker-metadata.outputs.tags }} | |
labels: ${{ steps.docker-metadata.outputs.labels }} |